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

ChangeStreams Examples for Docs

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: Docs Examples
    • Labels:
      None
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      NODE-1159 Fixed 3.0.0
      PYTHON-1393 Fixed 3.6
      SCALA-347 Fixed 2.2.0
      JAVA-2634 Fixed
      CSHARP-2064 Fixed 2.5
      CXX-1450 Fixed 3.3.0-rc0
      PHPLIB-289 Fixed 1.3.0
      RUBY-1248 Fixed
      CDRIVER-2323 Fixed 1.9.0
      PERL-809 Fixed 2.0.0
      SWIFT-170 Fixed 0.2.0
      RUST-43 Fixed 2.2.0
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion NODE-1159 Fixed 3.0.0 PYTHON-1393 Fixed 3.6 SCALA-347 Fixed 2.2.0 JAVA-2634 Fixed CSHARP-2064 Fixed 2.5 CXX-1450 Fixed 3.3.0-rc0 PHPLIB-289 Fixed 1.3.0 RUBY-1248 Fixed CDRIVER-2323 Fixed 1.9.0 PERL-809 Fixed 2.0.0 SWIFT-170 Fixed 0.2.0 RUST-43 Fixed 2.2.0

      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: behackett alyson.cabral rathi.gnanasekaran ravind.kumar

            Assignee:
            Unassigned Unassigned
            Reporter:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: