Allow cursor iteration with for-of

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 2.1.0
    • Affects Version/s: None
    • Component/s: AsyncRewriter
    • None
    • 5
    • Iteration Kentrosaurus, Iteration Lambeosaurus, Iteration Minmi
    • Needed
    • Hide

      https://www.mongodb.com/docs/manual/reference/method/cursor.forEach/ should mention that cursors can now be iterated via for ... of, as a more modern alternative to the .forEach() approach.

      Show
      https://www.mongodb.com/docs/manual/reference/method/cursor.forEach/ should mention that cursors can now be iterated via for ... of , as a more modern alternative to the .forEach() approach.

      Similar to how we apply the async rewriter to conditionally await the result of expressions, we could also add support to conditionally transform a for-of loop into a for-await-of loop, so that users could use for-of loops as the most idiomatic way of iterating over cursors.

              Assignee:
              Anna Henningsen
              Reporter:
              Anna Henningsen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: