Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13033

Document stopping/cancelling a change stream (unwatch)

    XMLWordPrintableJSON

Details

    • 2

    Description

      Description

      I can't find any documentation on how to "unwatch" a collection/database/cluster.

      https://mongodb.github.io/node-mongodb-native/3.3/api/Collection.html#watch

      https://mongodb.github.io/node-mongodb-native/3.3/api/Db.html#watch

      https://mongodb.github.io/node-mongodb-native/3.3/api/MongoClient.html#watch

      https://docs.mongodb.com/manual/changeStreams/

      https://docs.mongodb.com/manual/reference/method/db.collection.watch/

      https://docs.mongodb.com/manual/reference/method/db.watch/

       

      There is however a related ticket, CSHARP-2372, which mentions a "cancellation token". How does that translate to the Node driver? Does the change stream close or end when it gets garbage collected?

      A/C

      Each subtask complete showing how to unwatch/cancel a change stream

      Attachments

        Activity

          People

            mohammad.hunan@mongodb.com Mohammad Chughtai (Inactive)
            dandv Dan Dascalescu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              4 years, 1 day ago