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
What is the expected behavior?
I am proposing to change the QueryCursor's [Symbol.asyncIterator] to return a strictly-typed AsyncIterableIterator<DocType>, instead of the inherited AsyncIterableIterator<any>
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Mongoose v5.12.9
Node.js v12.22.1
MongoDB v4.4.6
TypeScript v4.2.4
The text was updated successfully, but these errors were encountered:
borfig
added a commit
to perceptionpoint/mongoose
that referenced
this issue
May 15, 2021
Do you want to request a feature or report a bug?
IMHO, it is a feature.
What is the current behavior?
When using
for await
with query cursors, the returned objects are of typeany
, which can hide possible bugs.The following buggy TypeScript code compiles, and the bug will be discovered only in runtime:
My
tsconfig.json
:What is the expected behavior?
I am proposing to change the
QueryCursor
's[Symbol.asyncIterator]
to return a strictly-typedAsyncIterableIterator<DocType>
, instead of the inheritedAsyncIterableIterator<any>
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
The text was updated successfully, but these errors were encountered: