Package dev.morphia.aggregation.stages
Class CollectionStats
java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.CollectionStats
Returns statistics regarding a collection or view.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CollectionStats
Creates a new collStats stagecount
(boolean count) Adds the total number of documents in the collection to the return document.histogram
(boolean histogram) Adds latency histogram information to the embedded documents in latencyStats if true.Specify the scale factor (i.e.
-
Method Details
-
collStats
Creates a new collStats stage- Returns:
- the new stage
- Since:
- 2.2
- MongoDB documentation
- Aggregration Pipeline Stage: $collStats
-
count
Adds the total number of documents in the collection to the return document.- Parameters:
count
- true to include the count- Returns:
- this
-
histogram
Adds latency histogram information to the embedded documents in latencyStats if true.- Parameters:
histogram
- whether to add the histogram- Returns:
- this
-
scale
Specify the scale factor (i.e. storageStats: { scale: <number> }) to use the specified scale factor for the various size data. For example, to display kilobytes rather than bytes, specify a scale value of 1024.If you specify a non-integer scale factor, MongoDB uses the integer part of the specified factor. For example, if you specify a scale factor of 1023.999, MongoDB uses 1023 as the scale factor.
The scale factor does not affect those sizes that specify the unit of measurement in the field name, such as "bytes currently in the cache".
- Parameters:
scale
- the scale- Returns:
- this
-