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

Modify Change Stream Output Examples

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • Docs Examples
    • None

    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
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: