On this page
db.serverStatus()
On this page
db.serverStatus( )-
Returns a document that provides an overview of the database process’s state.
- Starting in MongoDB 3.6.11,
db.serverStatus()includes in its output:metrics.repl.apply.batchSizeopReadConcernCountersopWriteConcernCounters(RequiresreportOpWriteConcernCountersInServerStatusparameter set totrue).
- Starting in MongoDB 3.6,
db.serverStatus()no longer outputs therangeDeletersection. - Starting in MongoDB 3.0,
db.serverStatus()no longer outputs theworkingSet,indexCounters, andrecordStatssections.
This command provides a wrapper around the database command
serverStatus. - Starting in MongoDB 3.6.11,
Behavior
By default, db.serverStatus() excludes in its output some content in the repl document.
To include fields that are excluded by default, specify the top-level field and set it to 1 in the command. To exclude fields that are included by default, specify the top-level field and set to 0 in the command.
For example, the following operation suppresses the repl, metrics and locks information in the output.
db.serverStatus( { repl: 0, metrics: 0, locks: 0 } )
The following example includes all repl information in the output:
db.serverStatus( { repl: 1 } )
See also
serverStatus for complete documentation of the output of this function.