---
title: "How to Search Mongo Databases (mongoDB)"
url: "https://dm0bkdes5q7a2ls.productfruits.help/en/article/how-to-search-mongo-databases-with-spirion-sensitive-data-platform"
language: "en"
last_updated: "2026-04-16T20:57:35.691Z"
---

# How to Search Mongo Databases (mongoDB)

This article describes how to craft a Mongo database connection string. This is required to add a Mongo database as a searchable Target in Spirion Sensitive Data Platform.

## Overview

To search a MongoDB database in Spirion Sensitive Data Platform requires a connection string. The connection string is used when configuring your MongoDB Target.

Troubleshooting a connection to the Mongo Database is also described in this article.

## Before You Start

-   Mongo Database connection strings can vary widely.
-   Consult your DBA when generating a connection string.
-   If you are using a **self-signed certificate**, you must use a different connection string. Example below.
-   -   Example of a working connection string requiring **SSL** and using **self-signed certificates**:
    
    ```xml
    mongodb://<username>:<password>@<hostname>:<port>/?ssl=true&sslAllowInvalidCertificates=true
    ```
    

## How to Create a Mongo Database Connection String

Creating a Mongo Database connection string is a manual process.

A typical connection string resembles the following code block:

```xml
<DatabaseItems Connection="mongodb://user:password@host_ip:host_port" Type="MongoDb" />
```

-   `<user>` is the username portion of the credentials
-   `<password>` is the password portion of the credentials
-   `<host_ip>` is the host name or IP address of the host server
-   `<host_port>` is the host port to connect through
-   -   **Default Port**: 27017 for MongoDB, if not specified
    -   If `<host_port>` is not provided, the colon character (':') must be omitted as well. 
    -   Following the above example, "`mongodb://<user>:<password>@<hostip>`" would be used to connect to port 27017 on the provided host IP address

## How to Add mongoDB as a Target in Spirion Sensitive Data Platform

Procedure:

1.  From the left side navigation menu select Data Asset Inventory > Data Assets and Targets.
2.  The "Data Assets and Targets" page opens.
3.  Select the TARGETS tab at the top of the page.  
      
    ![](https://cdn-assets.productfruits.com/8c2b63d3-4b1f-48f0-b27d-7b30fb317b67)
4.  Select the blue **Actions** button in the top right corner of the page.
5.  Select "Add Target" from the drop-down menu.
6.  Enter a descriptive name for the new database Target.
7.  Select the "Database" tile.
8.  The "Select a Database to Configure" pop-up window opens.
9.  Select the **mongoDB** tile under "Select a Database to Configure" from the bottom part of the pop-up window.  
      
    ![](https://cdn-assets.productfruits.com/cce46975-0e78-48a3-acd7-830c9ee3ed3f)
10.  The "Add New MongoDB Database Target" pop-up window opens.
11.  Enter the connection string for the desired Mongo database that you wish to scan.
12.  Click the **Save** button.  
       
     ![](https://cdn-assets.productfruits.com/3789b755-87ea-4010-9dee-695e066f1fa0)
13.  MongoDB is now conifgured in Spirion Sensitive Data Platform as a Target.
14.  Now you create a scan and configure it to scans this Target.
15.  Continue setting up your sensitive data scan using the instructions in this [article.](https://dm0bkdes5q7a2ls.productfruits.help/en/article/create-a-new-sensitive-data-scan)

## How to Troubleshoot a Mongo Database Connection

Several tools exist that can help troubleshoot a MongoDB connection.

### MongoDB Compass

MongoDB Compass helps users explore their data and test connection strings.

-   That can be found here: [https://www.mongodb.com/products/tools/compass](https://www.mongodb.com/products/tools/compass).

### Mongo Shell

Mongo Shell is a command-line tool that will help diagnose connection issues.

-   That can be found here: [https://www.mongodb.com/try/download/shell](https://www.mongodb.com/try/download/shell).
