-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
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:
Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
const cursor = db.collection<Pet>().find().map(pet => pet.age) cursor.next() // still returns Pet cursor.next<number>() // Overridable generic parameter