You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constMongoClient=require("mongodb").MongoClient;constassert=require("assert");/*Modify Change Stream Output using Aggregation PipelinesYou can control change stream output by providing an array of one or more of the following pipeline stages when configuring the change stream:$match, $project, $addFields, $replaceRoot, $redactSee Change Events for more information on the change stream response document format.*/constpipeline=[{$project: {documentKey: false}}];MongoClient.connect("mongodb://localhost:27017,localhost:27018,localhost:27019?replicaSet=mongo-repl").then(client=>{console.log("Connected correctly to server");// specify db and collectionsconstdb=client.db("superheroesdb");constcollection=db.collection("superheroes");constchangeStream=collection.watch(pipeline);// start listen to changeschangeStream.on("change",function(change){console.log(change);});}).catch(err=>{console.error(err);});
The text was updated successfully, but these errors were encountered:
Hi all,
How can I watch Change Streams with monk?
The text was updated successfully, but these errors were encountered: