MongoDB
MongoDB is the most commonly used NoSQL database. Here is everything you need to know to connect it to any of your other systems using Stacksync.
Last updated
MongoDB is the most commonly used NoSQL database. Here is everything you need to know to connect it to any of your other systems using Stacksync.
Last updated
The and are built-in tools managed by MongoDB and leveraged by Stacksync to track changes to your data in real time. Enabling replication is required to make them available.
Access must be given at the database level for changes to be correctly replicated. Individual collection access is not currently supported.
If a collection you see in your database does not appear in Stacksync, or changes are not correctly replicated, one of the previous conditions is not met. Please double check your setup in that case.
To connect your MongoDB database to Stacksync, you'll need the following data:
Protocol: must be mongodb+srv://
or mongodb://
.
Host: the URI or IP where the server can be found.
Port (optional): the default is usually 27017
.
Authentication method
Username: name used to authenticate with the server.
Password: the password used to authenticate with the server.
or
Database: the name of the database where data is present.
Connection options:
SSH Tunnel:
Username: The user Stacksync can identify as to establish the tunnel.
Host: IP of the machine to SSH into.
If you're not sure which format to use, we recommend using the (newer) SRV format.
SRV: mongodb+srv://[username:password@]host[/[defaultauthdb][?options]]
(elements in brackets []
are optional)
Example: mongodb+srv://myDatabaseUser:D1fficultP%40ssw0rd@cluster0.example.mongodb.net/?retryWrites=true&w=majority
Standard: mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
(elements in brackets []
are optional)
Example: mongodb://myDatabaseUser:D1fficultP%40ssw0rd@mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&replicaSet=myRepl
If you have any questions, don't hesitate to contact us at .
You can either enter these fields individually, or simply paste your directly, we'll take care of the rest.
TLS/SSL (X.509 Certificate): you must upload your public .pem file. In MongoDB Atlas :
(optional): allows you to specify the name of the replica set to connect to.
(optional): the database that holds the user's info. The default is admin
for username & password, and $external
for TLS.
Other connection options are not currently supported. If you need special assistance, please contact us at .
Public Key: copy into your machine's ~/.ssh/authorized_keys
file. You can use or simply SSH into the server and paste it using your preferred text editor.
SSH tunneling is currently only supported for single, self-hosted MongoDB instances via the mongodb:// protocol. For any further questions, please contact us at .
MongoDB has 2 formats for their . Make sure to pick the one that best suits your use case.
Find more examples .
To find out your connection string, check out MongoDB's , or .
If you have any questions, don't hesitate to contact us at , we're happy to help!