NewDocumentDB 1.0 is here. See what's new
MQL reference navigation

collStats

Returns collection statistics, including document count, document size, storage size, and index sizes.

db.flights.stats({ scale: 1024 })

The shell's stats() helper obtains collection statistics through aggregation. The fields below describe the direct collStats wire request.

ParameterDescription
collStats(Required) A string specifying the collection name.
scale(Optional) A number specifying the scale divisor for applicable byte-size fields; defaults to 1. Numeric BSON types are accepted and the backend truncates the value to an integer.

null or undefined scale uses 1; invalid types and invalid scale values fail. Options of the aggregation $collStats stage, such as latencyStats or queryExecStats, are not options forwarded by this wire-command adapter.

See wire protocol and common fields. Source: gateway processor/data_management.rs, process_coll_stats, and backend pg_documentdb/src/commands/coll_stats.c.