-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
-
Query Optimization 2021-03-08, Query Optimization 2021-03-22
-
157
During the spec writing of DRIVERS-1437 in SPEC-1780, where we were changing estimatedDocumentCount to use $collStats instead of count, we expected that doing so would allow estimatedDocumentCount to be used with a strict API. However, we found that the $collStats stage is not a part of versioned API, as shown in this error "expected no error, but got (APIStrictError) stage $collStats is not allowed with 'apiStrict: true' in API Version 1".
If the $collStats stage in not included in API version 1, drivers will have to deprecate the estimatedDocumentCount function altogether, which is not ideal nor is it the apparent goal of the scope for removing count from API version 1.
It seems as though $collStats was initially intended to be part of API version 1 but was not added for some reason.
- is related to
-
SERVER-53083 collStats results depend on topology and option.
- Closed
- related to
-
SERVER-56780 [4.4] mongod collStats does not handle large values for scale
- Closed