Add a way to strongly type cursors that have transform functions defined

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • 4.0.0
    • Affects Version/s: None
    • Component/s: None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • 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
      

              Assignee:
              Eric Adum (Inactive)
              Reporter:
              Neal Beeken
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: