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

Make "cursorState" a public API to wait for ready streams

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.6
    • Component/s: Core
    • Labels:
    • Environment:
      Any

      When getting a stream from a collection.watch, it should be possible to access cursorState to wait for a stream to be ready.

       

      My use case: I'm using WebSockets to let the client know when a specific collection change occurs. If I don't wait for the stream to be ready, it could happen that the client never gets informed about the collection change.

       

      This resulted from a question at stackoverflow: https://stackoverflow.com/questions/56699849/how-do-i-know-when-a-stream-node-js-mongodb-is-ready-for-changes/56708456#56708456

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            kontakt@julian-claus.de Julian Claus
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: