LogoDark mode logo
LogoDark mode logo
Contact SupportLoading Light/Dark Toggle

Data sources

data sourcesmongodb plugin

MongoDB plugin

Query any MongoDB-compatible database.

Hybrid plugin

The MongoDB plugin is a "hybrid" plugin, meaning it is available in SquaredUp as both a cloud and an on-prem plugin.

  • Use the cloud plugin if your MongoDB instance is publicly accessible. You do not need to configure a relay agent.
  • Use the on-prem plugin to access a MongoDB instance that is on a private network. You will need to configure a relay agent before you configure the MongoDB on-prem plugin.

    An on-prem data source uses a relay agent to connect SquaredUp to a data source running on your internal network.

    A relay agent is installed on a server on your internal network, and has access to your data source.

    Using a relay agent means that you don't need to open your firewall to allow access.

Adding a data source

To add a data source click on the + next to Data Sources on the left-hand menu in SquaredUp. Search for the data source and click on it to open the Configure data source page.

Before you start

Connection credentials

To connect to a MongoDB database you will need the following:

  • Connection string: This is a URI used to connect SquaredUp to your MongoDB database. For more information on MongoDB connection strings, see the MongoDB documentation.
  • Username and password: The credentials of a MongoDB user with read access to the collections you want to query data for.

Connection whitelisting

If you are connecting to a MongoDB Atlas instance, the following IP addresses must be whitelisted (depending on your region). See the MongoDB Atlas documentation:

  • US:52.20.146.185, 34.198.107.84
  • Europe:34.248.251.213, 54.73.229.191

Configuring the data source

  1. Display name:
    Enter a name for your data source. This helps you to identify this data source in the list of your data sources.

  2. Connection string:
    This must include the database name and resemble the format of mongodb://<server>/<DATABASE>. For more information on MongoDB connection strings, see the MongoDB documentation.

    To keep your password secure, the authentication credentials should be specified separately using the Username and Password fields.

  3. Username:
    Enter the username of your MongoDB user.
  4. Password:
    Enter the password of your MongoDB Username.
  5. (Optional) Restrict access to this data source:
    You can enable this option if you only want certain users or groups to have access to the data source, or the permission to link it to new workspaces. See data source access control for more information.

  6. Click Test and add to validate the data source configuration. SquaredUp will now attempt to connect to SquaredUp using the provided authentication method.

    • Testing passed – a success message will be displayed and then the configuration will be saved.
    • Testing passed with warnings – warnings will be listed and potential fixes suggested. You can still use the data source with warnings. Select Save with warnings if you believe that you can still use the data source as required with the warnings listed. Alternatively, address the issues listed and then select Rerun tests to validate the data source configuration again. If the validation now passes, click Save.
    • Testing Failed – errors will be listed and potential fixes suggested. You cannot use the data source with errors. You are able to select Save with errors if you believe that a system outside of SquaredUp is causing the error that you need to fix. Alternatively, address the issues listed and then select Rerun tests to validate the data source configuration again. If the validation now passes, click Save.

    You can edit any data source configurations at any time from Settings > Data Sources.

Next steps

Once you have successfully added the data source, you can create dashboards and visualize your data using MongoDB queries.

Configurable data streams

The following data streams installed with this plugin have configurable Parameters.

Data stream
Description
Parameters
Query
Return data by running a custom MongoDB query. You must build this query using the options on the Parameters tab.
  • Query operation:
    Select the type of query. Choose from:
    • Find
    • Find one
    • Count
    • Distinct field values
    • Aggregate
  • Collection name:
    Select a collection to run the query against from the dropdown. The list of collections should reflect the collections that the user has access to. If the collection is not listed, try entering the collection name manually.
  • Limit: (Find operation only)
    Specify the maximum number of documents to return.
  • Field: (Distinct field values operation only)
    Specify the field to query for distinct values
  • Filter: (All operations except Aggregate)
    Specify a query filter to limit the data you return, expressed in JSON. See MongoDB documentation on Query Filters.
  • Projection: (Find and Find one operations only)
    Specify the precise fields to return, expressed in JSON. See MongoDB documentation on Projections.
  • Sort: (Find operation only)
    Specify the sort order, expressed in JSON. See MongoDB documentation on Sorting.
  • Aggregation Pipeline: (Aggregation operation only)
    Specify an array of pipeline stages to aggregate the data by, expressed in JSON. See MongoDB documentation on Aggregation Pipelines.

Was this article helpful?


Have more questions or facing an issue?
Submit a ticket

On this page

  • Hybrid plugin
  • Adding a data source
  • Before you start
  • Connection credentials
  • Connection whitelisting
  • Configuring the data source
  • Next steps
  • Configurable data streams

Footer

Sites

  • SquaredUp
  • SQUAREDUP DS
  • DOWNLOAD
  • COMMUNITY ANSWERS

Quick Links

  • Contact Support
  • Events
  • Careers

Small Print

  • Privacy Policy
  • Terms and Conditions
YoutubeX (Twitter)LinkedInBlueSky

© SquaredUp 2025