What is MongoDB change stream?

Change streams allow applications to access real-time data changes without the complexity and risk of tailing the oplog . Applications can use change streams to subscribe to all data changes on a single collection, a database, or an entire deployment, and immediately react to them.

Read more

How do I listen to changes in MongoDB?

Open a Change Stream. You can watch for changes to a single collection, a database, or an entire deployment in MongoDB with Change Streams. Open a change stream by calling the watch() method on a Collection , Db , or MongoClient object . The change stream emits change event documents when they occur.

Read more