MongoDB Connection FAQ

How do I setup and connect to a remote MongoDB database?

MongoDB takes up a considerable amount of RAM and it's never a good idea to run your database service on the same server instance as your production services.

We recommend Guide to setting up and connecting to a remote MongoDB database.

How do I allow remote connection from my MongoDB to Databaselog?

For security reasons, it's recommended that MongoDB only be accessed from certain trusted locations, such as another server that hosts an application.

To connect your MongoDB to Databaselog, you need to allow access in the network settings of your server to the default MongoDB port (27017) for the IP address 165.22.32.162.

AWS Network Settings

How do I connect with read-only user?

Using read-only connection is recommended to be 100% safe.

1. Open up mongo shell and use admin database

ubuntu:~$ mongo

> use admin


2. Now use the database you want to create read-only user for:

> use mydatabase


3. Now create the user reader that will have access to read all the collections from the database:

> db.createUser({user: "username", pwd: "userpassword", roles: [{role: "read", db: "mydatabase"}]})

How do I format my Mongodb connecting string?

MongoDB connection string should be in the format below

mongodb://username:[email protected]_server_public_ip/database_name

How do I find my username and password?

If your mongod instance has authentication set up, you'll need the credentials of the MongoDB user that is configured on the project.

Why my connection doesn't work?

You need to make sure connection string is in the correct format and it's connecting to the single database directly.

We recommend to find advice at Standart Connection String or contact us.

How many databases can I connect with?

For now we only support a single MongoDB database per account. Contact support if you need more, please.