Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1527

Allow cursor iteration with for-of

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.0
    • Affects Version/s: None
    • Component/s: AsyncWriter
    • None
    • 5
    • 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.
    • Iteration Kentrosaurus, Iteration Lambeosaurus, Iteration Minmi

      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@mongodb.com Anna Henningsen
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: