Overview
Every mongod instance has its own local database, which
stores data used in the replication process, and other
instance-specific data. The local database is invisible to
replication: collections in the local database are not replicated.
Collections on all mongod Instances
local.startup_logOn startup, each
mongodinstance inserts a document intostartup_logwith diagnostic information about themongodinstance itself and host information.startup_logis a capped collection. This information is primarily useful for diagnostic purposes.For example, the following is a prototype of a document from the
startup_logcollection:{ "_id" : "<string>", "hostname" : "<string>", "startTime" : ISODate("<date>"), "startTimeLocal" : "<string>", "cmdLine" : { "dbpath" : "<path>", "<option>" : <value> }, "pid" : <number>, "buildinfo" : { "version" : "<string>", "gitVersion" : "<string>", "sysInfo" : "<string>", "loaderFlags" : "<string>", "compilerFlags" : "<string>", "allocator" : "<string>", "versionArray" : [ <num>, <num>, <...> ], "javascriptEngine" : "<string>", "bits" : <number>, "debug" : <boolean>, "maxBsonObjectSize" : <number> } } Documents in the
startup_logcollection contain the following fields:local.startup_log.startTimeA UTC ISODate value that reflects when the server started.
local.startup_log.startTimeLocalA string that reports the
startTimein the system's local time zone.
local.startup_log.cmdLineAn embedded document that reports the
mongodruntime options and their values.
local.startup_log.buildinfoAn embedded document that reports information about the build environment and settings used to compile this
mongod. This is the same output asbuildInfo. SeebuildInfo.
Collections on Replica Set Members
local.system.replsetlocal.system.replsetholds the replica set's configuration object as its single document. To view the object's configuration information, issuers.conf()from themongoshell. You can also query this collection directly.
local.oplog.rslocal.oplog.rsis the capped collection that holds the oplog. You set its size at creation using theoplogSizeMBsetting. To resize the oplog after replica set initiation, use the Change the Size of the Oplog procedure. For additional information, see the Oplog Size section.The oplog can grow past its configured size limit to avoid deleting the
majority commit point.Starting in MongoDB 4.4.2, it is no longer possible to perform manual write operations to the oplog on a cluster running as a replica set. Performing write operations to the oplog when running as a standalone instance should only be done with guidance from MongoDB Support.
Restrictions
- Multi-Document Transactions on
local - You cannot perform read/write operations to the collections in the
localdatabase inside a multi-document transaction. - Retryable Writes against
local You cannot perform write operations to collections in the
localdatabase with retryable writes enabled.Important
The official MongoDB 4.2-series drivers enable retryable writes by default. Applications which write to the
localdatabase will encounter write errors upon upgrading to 4.2-series drivers unless retryable writes are explicitly disabled.To disable retryable writes, specify
retryWrites=falsein the connection string for the MongoDB cluster.