Knowledge base

Allowing Xplenty access to MongoDB

Xplenty can access your MongoDB on a variety of services and deployment models. This article discusses providing Xplenty access on your MongoDB and then details creating the MongoDB connection in Xplenty.

You must provide Xplenty access to MongoDB. If it is behind a firewall:

  • Create a MongoDB user and grant it minimum permissions required for Xplenty to read or write data from the database.
  • Allow access from Xplenty's IP addresses to MongoDB's port.

To create a MongoDB connection In Xplenty

  1. Click the Connections icon (lightning bolt) on the top left menu.
  2. To create a connection, click New connection. 
    Screen Shot 2020-03-16 at 3.44.54 PM
  3. Choose MongoDB.
  4. In the new Mongo DB connection window, name the connection and enter the connection information:
    • Name - name for the new connection
    • User name - database user name
    • Password - database user's password
    • Hostname - name of the host to connect to
    • Port - TCP port to connect to. Allow Xplenty access to this port on the specified host for connectivity
    • Read Preference - Determines how the connection should route read operations to members of a replica set.
    • Connection Scheme 
      • DNS Seed List (SRV) - Connects via the mongodb+srv:// syntax (Read more here)
      • Replica Set Members - Connects via the mongodb:// syntax. Specify the replica set members hostname manually.
    • Database - name of database to use
    • Authentication Database - name of the database to use for authentication. Leave empty to use default database.
    • Connect using SSL - Determines whether to connect to the database using SSL. SSL allows encryption of client/server communications for increased security. Always check SSL if connecting to Mongo Atlas.
  5. You can test the MongoDB connection by clicking Test connection. Note that although the test may fail, a job may be able to use the connection because the cluster on which you execute the job may have access to the database, whereas the Xplenty web application may not.

To modify MongoDB connections in Xplenty:

  1. Click the Connections icon (lightning bolt) on the top left menu.
  2. Click a connection to open and modify it. Make any necessary changes, then click Test connection, and Save changes. To exit the MongoDB connection window without changes, click Back to connections (grey tab on the left side) on the MongoDB connection window.
  3. To delete a MongoDB connection, click on the three vertical dots on the far right of the connection listing and select the Delete connection option.
    Screen Shot 2020-01-03 at 2.43.17 PM

Note: For information on connecting to MongoDB Atlas, see here.