node.js with mongo change streams
credits: Lauren Schaefer | https://www.mongodb.com/developer/languages/javascript/nodejs-change-streams-triggers/
-
setup mongo cluster with sample data. ref: https://www.mongodb.com/docs/charts/tutorial/order-data/prerequisites-setup/#load-the-sample-data
-
create .env with MONGODB_URI env having connection string from the cluster created above
npm i
run in seperate terminals
node changeStreams.js
node changeStreamsTestData.js