To access your data in real time, all you need to do is change from the
get method to the
watch method and then update your response to an event-based promise.
There are multiple event types that you can choose from for your watch task.
|changes||Watches for newly created or updated documents||Returns list of previous 500 changed documents|
|create||Watches for newly created documents||Returns most recently created document|
|delete||Watches for newly deleted documents||Returns most recently deleted document|
|update||Watches for newly updated||Returns most recently updated document|
get, you also must pass the collection, or data path, that you want to watch (