React to data changes in real time
db.collection.watch() returns a tailable cursor of insert/update/delete events. Powers event-driven architectures without polling like it's 2009.
Requires replica set. Your Kafka cluster may have opinions about overlap.
Output
Press Run to execute your code.