Is there any built-in method that i can use to check if the data in the database has changed?
Asked
Active
Viewed 635 times
0
-
possible duplicate of [How to listen for changes to a MongoDB collection?](http://stackoverflow.com/questions/9691316/how-to-listen-for-changes-to-a-mongodb-collection) – freakish Jun 27 '15 at 06:33
-
but is there any method other than the tailable cursors? – Nisthar Jun 27 '15 at 06:48
-
@Nisthar In short: No. A bit longer: I usually implement an [observer pattern](https://en.m.wikipedia.org/wiki/Observer_pattern): Before or after I change the data in my service layer, I notify the observers. – Markus W Mahlberg Jun 27 '15 at 08:42
-
@MarkusWMahlberg, thnx.it would be easy if there is any built-in method in mongoose or some other libs. – Nisthar Jun 27 '15 at 08:52
-
There is a module for implementing the observer pattern in node.js – Markus W Mahlberg Jun 27 '15 at 08:53
-
@MarkusWMahlberg, Whts module name? and how to implement? – Nisthar Jun 27 '15 at 09:05