db.serverStatus()

  • db.serverStatus()
  • Returns a document that provides an overview of thedatabase process’s state.

This command provides a wrapper around the database commandserverStatus.

Behavior

By default, db.serverStatus() excludes in its output some content inthe repl document.

To include fields that are excluded by default, specify the top-levelfield and set it to 1 in the command. To exclude fields that areincluded by default, specify the top-level field and set to 0 inthe command.

For example, the following operation suppresses the repl,metrics and locks information in the output.

  1. db.serverStatus( { repl: 0, metrics: 0, locks: 0 } )

The following example includes all replinformation in the output:

  1. db.serverStatus( { repl: 1 } )

Output

See serverStatus Output for completedocumentation of the output of this function.