Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 1.21 KB

collStats.md

File metadata and controls

25 lines (18 loc) · 1.21 KB
title collStats
description Return collection statistics in DocumentDB with a configurable size scale.
type commands
category diagnostic

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.

Parameter Description
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.