Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1494

Add pipeline stage to ChangeStreams example for Docs

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.4.0
    • Documentation

    Description

      In a previous ticket DRIVERS-414, included Example 1-3. This ticket is to add the Example 4 section to the existing example :

      // Start Changestream Example 1
       
      MongoCursor<Document> cursor = inventory.watch().iterator();
      Document next = cursor.next();
       
      // End Changestream Example 1
      

      // Start Changestream Example 2
       
      MongoCursor<Document> cursor = 
      inventory.watch().fullDocument(FullDocument.UPDATE_LOOKUP).iterator();
      Document next = cursor.next();
       
      // End Changestream Example 2
      

      // Start Changestream Example 3
       
      Document resumeToken = next.get("_id", Document.class);
      MongoCursor<Document> cursor = inventory.watch().resumeAfter(resumeToken).iterator();
      cursor.next();
       
      // End Changestream Example 3
      

      // Start Changestream Example 4
       
      List<Bson> pipeline = singletonList(Aggregates.match(Filters.or(
         Document.parse("{'fullDocument.username': 'alice'}"),
         Filters.in("operationType", asList("delete")))));
       
      // End Changestream Example 4
      

      Attachments

        Issue Links

          Activity

            People

              jesse@mongodb.com A. Jesse Jiryu Davis
              rathi.gnanasekaran Rathi Gnanasekaran
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: