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

Document stopping/cancelling a change stream (unwatch)

    XMLWordPrintable

    Details

    • Last comment by Customer:
      true
    • Story Points:
      2
    • Sprint:
      DET: FY2021Q1S1

      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

            Assignee:
            mohammad.hunan Mohammad Chughtai
            Reporter:
            dandv Dan Dascalescu
            Participants:
            Last commenter:
            Mohammad Chughtai Mohammad Chughtai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              1 year, 24 weeks, 1 day ago
              Date of 1st Reply: