[CSHARP-2343] Modify Change Stream Output Examples Created: 27/Jul/18  Updated: 28/Oct/23  Resolved: 29/Nov/18

Status: Closed
Project: C# Driver
Component/s: Documentation
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: Dmitry Lukyanov (Inactive)
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-537 Modify Change Stream Output Examples Closed

 Description   

See DRIVERS-537 for details.



 Comments   
Comment by Githook User [ 28/Nov/18 ]

Author:

{'name': 'Dmitry Lukyanov', 'email': 'dmitry_lukyanov@epam.com', 'username': 'dmitry-lukyanov'}

Message: CSHARP-2343: Add documentation sample for change stream.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/bead6b3cbb72dd81e68cd4ff7af6b9ecd2598992

Comment by Dmitry Lukyanov (Inactive) [ 21/Nov/18 ]

Note: as it was disccussed with rathi.gnanasekaran, "Changestream Example 4" from this ticket was combined with "Changestream Example 4" from the ticket https://jira.mongodb.org/browse/CSHARP-2148 .

The final query:

const pipeline = [
{ $match: { $or : [{ 'fullDocument.username': 'alice' }, { 'operationType' : 'delete' }] } },
{ $addFields: { newField: 'this is an added field!' } }
];
const collection = db.collection('inventory');
const changeStream = collection.watch(pipeline);
const next = await changeStream.next();

 

cc: rstam

Generated at Wed Feb 07 21:42:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.