MENU
    MongoDB Setup Guide
    • 28 Jul 2022
    • 2 Minutes to read

    MongoDB Setup Guide


    Article summary

    Before you start
    • Note the name, the host, and the port of the Mongo database.
    • Note the username and password for the user connecting to the database.
    • Note: MongoDB stores documents in collections. Collections are analogous to tables in relational databases.
    SRV:

    Panoply supports MongoDB Atlas connections that use SRV. MongoDB describes SRV here:. In technical terms, the use of SRV eliminates the requirement for every client to pass in a complete set of state information for the cluster. Instead, a single SRV record identifies all the nodes associated with the cluster (and their port numbers) and an associated TXT record defines the options for the URI.

    1. If necessary, whitelist Panoply.
      • Mongo databases with production data are typically not publicly available. To allow Panoply to access your data, see Whitelisting.
    2. Click Data Sources in the navigation menu.
    3. Click the Add Data Source button.
    4. Search for MongoDB and select it.
    5. Enter the credentials to connect toMongoDB. If you're not sure what your connection details are, contact your administrator. To find the information on the hostname, ask your administrator or see Host Info in the documentation.
      • Host Address - The URL of the database or the IP address of the host server.
        • URL example: your.server.com
        • IP example: 123.45.67.89
      • Mongo allows you to specify more than one host by separating them with commas. When the port is provided in the host, it will be used, otherwise the value from the port parameter will be used. For example, if the host is a.b.com,d.e.net:1234,f.g.ukport=27017, the connection string will eventually be formed as a.b.com:27017,d.e.net:1234,f.g.uk:27017.
      • Port - The port number of the server. This is 27017 for most connections.
      • Users can specify to which node (primary or secondary) to connect by adding the suffix /?readPreference=secondary to the host address in the Mongo source configuration. See the Mongo documentation.
      • To connect using SSL instead:
        • Enter your Client Certificate
        • Enter your Client Key
        • Enter your SSL Certificate
    6. Enter your MongoDB username and password. This user must have permission to access the data in the collections to be used. If the permissions are not in place, some of the data will not be available.
      • Each user must be granted a role. The role determines the user’s access to database resources and operations.
      • A user can have multiple roles. 
      • The user must have at least the Read client role.
      • The user need the following rights assigned to their role:
        • find
        • listCollections
        • ListDatabases
    7. (Optional) Enter your Auth Source and Replica Set.
    8. Select the MongoDB database to collect the data from. This will load the collections (tables and views) that the user has permissions to access.
    Note:

    This may take time to load.

    9. Select one or more collections (tables or views).

    1. Click Save Changes and then Collect.
      • The data source appears grayed out while the collection runs.
      • You may add additional data sources while this collection runs.
      • You can monitor this collection from the Jobs page or the Data Sources page.
      • After a successful collection, navigate to the Tables page to review the data results.

    Was this article helpful?