-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
NODE-3867 Description
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
- is depended on by
-
NODE-3867 FindCursor.count() returns limit count instead of document that matched query count
- Closed