stats() - Prints database statistics

Prints statistics which describe the database's state.

Syntax diagram

Read syntax diagramSkip visual syntax diagramdb.stats()

Example

Example 1: Collect statistics for the books collection.
db.stats()
Sample output:
{
  "collections":46,
  "objects":6754,
  "indexes":55,
  "ok":1
  }