Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4683

Make ChangeStream an async iterable

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.12.0
    • Affects Version/s: None
    • Component/s: None
    • 3
    • Not Needed
    • Needed

      Change streams support manual promise-based iteration using `next`, `hasNext` and `tryNext`.  Making the ChangeStream an async iterable would allow idiomatic use in for-await loops.

      Additionally, we could use this in conjunction with Readable.from to convert our change stream to a NodeJS readable stream automatically, with full support for resumability (future improvement and not in scope for this work).

      Acceptance Criteria

      • Implement Symbol.asyncIterator for the ChangeStream class

            Assignee:
            andy.mina@mongodb.com Andy Mina
            Reporter:
            bailey.pearson@mongodb.com Bailey Pearson
            Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: