Many applications need to be alerted when new documents are inserted or modified in the database. These include real-time apps, or features such as notifications, messaging, or chat.
It is possible to build this kind of application with MongoDB, using features that are native to the database: Capped Collections and Tailable Cursors!
Details and code samples that illustrate this technique are provided in How to Create a Pub/Sub application with MongoDB. There’s also a screencast that shows the application built in the blog post:
Application Code is available on GitHub.