Change streams let applications subscribe to real-time changes in MongoDB data — receiving notifications when documents are inserted, updated, or deleted. They enable reactive, event-driven features (real-time updates, syncing, triggers) without polling the database. Built on the replica set oplog.
Watching for changes
changeStream = db.().();
changeStream.(, {
.(change.);
.(change.);
});
