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
I have searched existing issues to ensure the bug has not already been reported
Mongoose version
6.6.1
Node.js version
18+
MongoDB server version
6+
Typescript version (if applicable)
4.5.5
Description
The fn callback for eachAsync should allow for an index parameter; however, the typescript definitions only allow for a single DocType or DocType[] param.
Use mongoose in a .ts file and try Thing.find({}).cursor().eachAsync(async (doc, i) => { }) ... this will cause a typescript error No overload matches this call.
Expected Behavior
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Mongoose version
6.6.1
Node.js version
18+
MongoDB server version
6+
Typescript version (if applicable)
4.5.5
Description
The
fn
callback for eachAsync should allow for an index parameter; however, the typescript definitions only allow for a single DocType or DocType[] param.The function is properly shown in the documentation to allow
i
as an index here https://mongoosejs.com/docs/api/querycursor.html#querycursor_QueryCursor-eachAsync but the typescript definitions below prevent use of the second argSteps to Reproduce
Use mongoose in a
.ts
file and tryThing.find({}).cursor().eachAsync(async (doc, i) => { })
... this will cause a typescript errorNo overload matches this call.
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: