Bra*_*don 14
嗯,这是一个老问题,但我正在努力做同样的事情.我找到了一些帮助我整理解决方案的花絮,我把它作为一个库发布:
https://github.com/TorchlightSoftware/mongo-watch
该库是用coffeescript编写的.这是javascript中的一个例子,对于那些喜欢的人.
var MongoWatch = require('mongo-watch'),
watcher = new MongoWatch({parser: 'pretty'});
watcher.watch('test.users', function(event) {
return console.log('something changed:', event);
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6782 次 |
| 最近记录: |