-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
db.stats.txt
73 lines (43 loc) · 1.37 KB
/
db.stats.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
==========
db.stats()
==========
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Description
-----------
.. method:: db.stats(scale)
Returns statistics that reflect the use state of a single :term:`database`.
The :method:`db.stats()` method has the following parameter:
.. list-table::
:header-rows: 1
:widths: 20 20 80
* - Parameter
- Type
- Description
* - ``scale``
- number
- Optional. The scale at which to deliver results. Unless specified, this command
returns all data in bytes.
:returns: A :term:`document` with statistics reflecting
the database system's state. For an explanation of the
output, see :doc:`/reference/command/dbStats`.
The :method:`db.stats()` method is a wrapper around the
:dbcommand:`dbStats` database command.
Behavior
--------
Accuracy after Unexpected Shutdown
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. |cmd| replace:: :method:`db.stats`
.. |opt| replace:: count and size
.. include:: /includes/fact-unexpected-shutdown-accuracy.rst
Example
-------
The following example converts the returned values to kilobytes:
.. code-block:: javascript
db.stats(1024)
.. note::
The scale factor rounds values to whole numbers.