[DRIVERS-537] Modify Change Stream Output Examples Created: 16/Jul/18  Updated: 28/Oct/23  Resolved: 01/Jul/20

Status: Closed
Project: Drivers
Component/s: Docs Examples
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on JAVA-2973 Modify Change Stream Output Examples Closed
depends on PHPLIB-381 Modify Change Stream Output Examples Closed
depends on CDRIVER-2774 Modify Change Stream Output Examples Closed
depends on CSHARP-2343 Modify Change Stream Output Examples Closed
depends on MOTOR-263 Create Change Stream Examples Closed
depends on PYTHON-1621 Modify Change Stream Output Examples Closed
depends on RUBY-1413 Modify Change Stream Output Examples Closed
Related
related to DOCS-11922 Missing change streams examples with ... Closed
related to DRIVERS-436 Add pipeline stage to ChangeStreams e... Closed
Driver Compliance:
Key Status/Resolution FixVersion
PYTHON-1621 Fixed 3.8
CSHARP-2343 Fixed
RUBY-1413 Fixed 2.13.0.rc1
PHPLIB-381 Fixed 1.4.3
MOTOR-263 Fixed 2.1
CDRIVER-2774 Fixed 1.13.0
JAVA-2973 Fixed
SWIFT-612 Done

 Description   

Hi – for https://docs.mongodb.com/manual/changeStreams/#modify-change-stream-output
we seem to be missing Modify Change Stream Output examples – not sure what the process was for the example 4, guessing it was some last minute one-off for the node and java. In any case, if we could have example 4 (using node.js as the template) for the following drivers:

  • Python
  • PHP
  • Motor
  • C
  • C#
  • Ruby

// Start Changestream Example 4
 
const pipeline = [
  { $match: { 'fullDocument.username': 'alice' } },
  { $addFields: { newField: 'this is an added field!' } }
];
const collection = db.collection('inventory');
const changeStream = collection.watch(pipeline);
const next = await changeStream.next();
 
// End Changestream Example 4



 Comments   
Comment by A. Jesse Jiryu Davis [ 12/Sep/18 ]

There were a number of mistakes, ambiguities, and contradictions in the tickets for 4.0 driver examples. Let’s keep an eye on this and be more methodical next time please.

Comment by Kay Kim (Inactive) [ 11/Sep/18 ]

kevin.albertson – Holy cow. Thanks for drawing attention to the fact that there are two drivers tickets for this.
I would go with this one since it's shows a pipeline with multiple stages as well as the { operationType:

{ $in: [ 'delete' ] }

} is a little weird use for the $in operator since being only used with a single value

cc: rathi.gnanasekaran sue.kerschbaumer

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