Skip to main content

MongoDB

Getting started with MongoDB

To use any of the above modules, you need to have a running instance of MongoDB configured for public access from the Internet.

Connect MongoDB to Make

Please select version 2.2.12 in Mongo settings:

61f273b9c7cbe.png

To connect your MongoDB instance to Make, follow the general instructions for Connecting to services. You will be prompted to enter your MongoDB connection string. Please include the username, password, and database in this connection string. If you don't know what it is or how to get it, please look here: https://docs.mongodb.com/manual/reference/connection-string/.

mongodb://demo:[email protected]:27017/MYBASENAME?ssl=true&replicaSet=atlas-121294-shard-0&authSource=admin&retryWrites=true&w=majority

After you have filled in the 'Connection string' field you can press the Continue button and Make will try to establish a connection to your database. If it succeeds, the dialog will close and you will be able to continue setting up your module.

Make will make connections to your database from its IP addresses. Ensure you whitelist these IPs to allow connections to your MongoDB servers.

Obtain connection string

To obtain the connection string to connect to Make:

  1. Start string with mongodb:// and your user and password separated by column, user:password.

    mongodb://user:password

  2. Click Database > MyClass.

    mongodb-1.jpeg
  3. Copy the primary address.

    mongodb-2.jpeg
  4. Copy the cluster address and add it to the line in step 1.

    mongodb-3.jpeg

    mongodb://user:[email protected]:27017

  5. Add your database name to the above string.

    mongodb-4.jpeg

    mongodb://user:[email protected]:27017/<mydatabasename>

  6. Add the required parameters to the string, ?ssl=true&amp;authSource=admin&amp;retryWrites=true&amp;w=majority

Your connection string is ready.

mongodb://user:[email protected]:27017/mydatabasename?ssl=true&amp;authSource=admin&amp;retryWrites=true&amp;w=majority

Date/time queries

To perform a date/time query, use the ISO 8601 format with milliseconds and no time zone offset. E.g. 2019-05-06T16:19:03.123Z.