-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: 4.2.2
-
Component/s: None
What problem are you facing?
`FindCursor.count()` is only returning the limit document count when using the limit option with a `collection.find()` command.
What driver and relevant dependency versions are you using?
Node.JS
"mongodb": "^4.2.1",
"mongodb-client-encryption": "^1.2.6",
Steps to reproduce?
1. Use `collection.find()` with a collection that has multiple documents returned.
2. Use `cursor.count()` to retrieve all documents.
3. Process the same `collection.find({}, {limit: 1})` with a collection that has multiple documents returned.
4. See that the `count()` method only returns 1 as the total instead of the total documents that match the query
- depends on
-
NODE-3868 Investigate NODE-3867 - FindCursor.count() returns limit count instead of document that matched query count
- Closed
- is related to
-
MONGOSH-1287 cursor.count() is deprecated in the driver
- Closed
-
NODE-2421 Cursor.count() - Wrong default value for applySkipLimit when used with promises
- Closed