You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CHANGES_4.0.0.md
+7
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,13 @@ for await (const doc of cursor) {
96
96
Prior to the this release there was inconsistency surrounding how the cursor would error if a setting like limit was applied after cursor execution had begun.
97
97
Now, an error along the lines of: `Cursor is already initialized` is thrown.
98
98
99
+
##### Cursor.count always respects skip and limit
100
+
101
+
> Updated: Feb 3rd 2022
102
+
103
+
The `applySkipLimit` argument has been removed from `cursor.count`, cursors will always passthrough the skip and limit to the underlying count operation.
104
+
It is recommended that users utilize the `collection.countDocuments` or `collection.estimatedDocumentCount` APIs.
105
+
99
106
#### ChangeStream must be used as an iterator or an event emitter
100
107
101
108
You cannot use ChangeStream as an iterator after using as an EventEmitter nor visa versa.
'cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead '
137
+
);
130
138
if(typeofoptions==='boolean'){
131
139
thrownewMongoInvalidArgumentError('Invalid first parameter to count');
0 commit comments