About the local database

mongod reserves the database local for special functionality. It is special in that its contents are never replicated.

When authentication is used, authenticating against the local database is equivalent to authenticating against the admin database: it gives you permissions across all databases, not just local.

Replica Sets

Replica sets use the following collections in local:

  • local.system.replset the replica set's configuration object is stored here. (View via the rs.conf() helper in the shell – or query it directly.)
  • local.oplog.rs is a capped collection that is the oplog. You can use the --oplogSize command line parameter to set the size of this collection.
  • local.replset.minvalid sometimes contains an object used internally by replica sets to track sync status

Master/Slave Replication

  • Master
    • local.oplog.$main the "oplog"
    • local.slaves
  • Slave
    • local.sources
  • Other
    • local.me
    • local.pair.* (replica pairs, which are deprecated)

Follow @mongodb

MongoDB Pittsburgh - May 15
MongoNYC - May 23
MongoDB Paris - Jun 14
MongoDB UK - Jun 20
MongoDC - June 26


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

PLEASE POST QUESTIONS IN THE USER GROUPS FORUM. Post non-question comments and helpful hints here.

blog comments powered by Disqus