[JAVA-2732] Add pipeline stage to ChangeStreams example for Docs Created: 12/Jan/18  Updated: 28/Oct/23  Resolved: 18/Jan/18

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-436 Add pipeline stage to ChangeStreams e... Closed

 Description   

In a previous ticket DRIVERS-414, included Example 1-3. This ticket is to add the Example 4 sections 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



 Comments   
Comment by Githook User [ 22/Jan/18 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Added a delete to the watch documentation samples

Prevents the test timing out.

JAVA-2732
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/c5028d4556d3c20232662e47acea069a039316a3

Comment by Githook User [ 18/Jan/18 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Docs: Added pipeline example to change stream examples (#240)

JAVA-2732
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/12a5c19293c9062c631215a7ca020a0beae9c25b

Generated at Thu Feb 08 08:57:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.