-
Type:
Bug
-
Status: Closed
-
Priority:
Minor - P4
-
Resolution: Fixed
-
Affects Version/s: 4.0.3, 4.1.4
-
Component/s: Querying
-
Labels:
-
Backwards Compatibility:Minor Change
-
Operating System:ALL
-
Backport Requested:v4.2, v4.0
-
Steps To Reproduce:
-
Epic Link:
`countDocuments` throws an error when matching 0 document.
I would have expected it to follow what `count` does, which is return 0.
With both versions `4.0.3` and `4.1.4` (haven't checked intermediary ones), the error I get from the bellow `steps to reproduce` is:
2018-10-20T16:26:44.252+0100 E QUERY [js] TypeError: res[0] is undefined :
|
DBCollection.prototype.countDocuments@src/mongo/shell/collection.js:1418:5
|
@(shell):1:1
|
|
- is documented by
-
DOCS-12966 Investigate changes in SERVER-37690: countDocuments throws an error when matching 0 document
-
- Closed
-
- is related to
-
SERVER-40718 Validate parameters for estimatedDocumentCount
-
- Open
-