Details
-
Improvement
-
Status: Closed
-
Unknown
-
Resolution: Fixed
-
None
-
None
-
None
-
Not Needed
Description
Currently if you call cursor.map(). There is no way to change the type that .next() returns based on the provided transform. We mitigate this problem by permitted user overrides in the various iteration methods.
Example:
const cursor = db.collection<Pet>().find().map(pet => pet.age)
|
cursor.next() // still returns Pet
|
cursor.next<number>() // Overridable generic parameter
|