IBM Cloud Docs
MongoDB operations log (oplog) FAQ

MongoDB operations log (oplog) FAQ

The MongoDB oplog (operations log) is a special capped collection that records all operations that modify the data stored in the database. For more information, see Replica Set Oplog.

Creating a user with read-only access to oplog

To access the MongoDB oplog through oplogUrl, create an oplog user using the IBM Cloud® Databases for MongoDB admin user. The oplog user can set &readPreference=primary so that reads always happen from the primary.

As the admin user, use a command like:

db.createUser({user: "oplogUser", pwd: "PASSWORD", roles: [{role: "read", db: "local"}]})

Set up Mongodb for open source application use

To set up Databases for MongoDB for use with open-source software, like Meteor.js, configure your MongoDB connection string.

  1. Create a user that can read the oplog.
  2. Configure your MongoDB server oplog URL environment variable. For more information, see Meteor's MONGO_OPLOG_URL.