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.
Prerequisites
// Grant user roles without overwriting existing ones (specific DBs)
use admin
const user = db.getUser("<user>"); // Change to your username
const updatedRoles = user.roles.concat([
{ role: "read", db: "local" }, // required to read the oplog and therefore read changes from mongodb
{ role: "readWrite", db: "<db1>" }, // when need to read and write to mongodb
{ role: "read", db: "<db2>" }, // when do not need to write to mongodb
// Add the database(s) you want Stacksync to have access to
]);
db.updateUser("<user>", { roles: updatedRoles });Connecting your MongoDB instance


Connection strings
Getting your connection string
Last updated

