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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: 3.2.6
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      Any
    • MongoDB Version:
      4.0.10

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: