Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-414

ChangeStreams Examples for Docs

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6 Required
    • Component/s: Documentation Examples
    • Security Level: Public
    • Labels:
      None
    • # Replies:
      0
    • Last comment by Customer:
      false
    • SERVER fixVersion:
      3.6

      Description

      Similar to what we did for the crud examples, if all the drivers could implement the following changestream examples which the docs team can extract:

      We'll use the inventory collection.
      The examples are from the java examples from Aly's POD.

      // 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
      

      cc: Bernie Hackett Alyson Cabral Rathi Gnanasekaran Ravind Kumar

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              kay.kim Kay Kim (Inactive)
              Participants:
              Last commenter:
              Kaitlin Mahar
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                2 years, 40 weeks, 1 day ago
                Date of 1st Reply: