Skip to content

Commit 66b3607

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCS-13941-collstats-error (#433) (#440)
* DOCS-13941-collstats-error * DOCS-13941-collstats-error Co-authored-by: jason-price-mongodb <[email protected]> Co-authored-by: jason-price-mongodb <[email protected]>
1 parent 650e00f commit 66b3607

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

source/reference/command/collStats.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,31 @@ Replica Set Member State Restriction
112112

113113
.. |operations| replace:: :dbcommand:`collStats`
114114

115+
Non-Existent Collections
116+
~~~~~~~~~~~~~~~~~~~~~~~~
117+
118+
If you run :dbcommand:`collStats` for a non-existent collection, then
119+
depending on your database implementation, :dbcommand:`collStats` might
120+
return ``0`` values in the output fields instead of returning an error.
121+
122+
For example:
123+
124+
.. code-block:: javascript
125+
126+
db.runCommand( { collStats : "nonExistentCollection" } )
127+
128+
Example output with ``0`` values in the fields:
129+
130+
.. code-block:: javascript
131+
:copyable: false
132+
133+
{
134+
ns: 'test.nonExistentCollection',
135+
size: 0,
136+
count: 0,
137+
...
138+
}
139+
115140
Example
116141
-------
117142

0 commit comments

Comments
 (0)