File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,11 @@ The new minimum supported Node.js version is now 14.20.1.
192192The MongoClient option ` promiseLibrary ` along with the ` Promise.set ` export that allows specifying a custom promise library has been removed.
193193This allows the driver to adopt async/await syntax which has [ performance benefits] ( https://v8.dev/blog/fast-async ) over manual promise construction.
194194
195+ ### Cursors now implement ` AsyncGenerator ` interface instead of ` AsyncIterator `
196+
197+ All cursor types have been changed to implement ` AsyncGenerator ` instead of ` AsyncIterator ` .
198+ This was done to make our typing more accurate.
199+
195200### Cursor closes on exit of for await of loops
196201
197202Cursors will now automatically close when exiting a for await of loop on the cursor itself.
Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ export abstract class AbstractCursor<
288288 return bufferedDocs ;
289289 }
290290
291- async * [ Symbol . asyncIterator ] ( ) : AsyncIterator < TSchema , void > {
291+ async * [ Symbol . asyncIterator ] ( ) : AsyncGenerator < TSchema , void , void > {
292292 if ( this . closed ) {
293293 return ;
294294 }
You can’t perform that action at this time.
0 commit comments