title: Listening to changes in MongoDB in Express
body: <p>I'm very new to node and express but I'm trying to implement mongo-watch (<a href="https://github.com/TorchlightSoftware/mongo-watch" rel="nofollow">https://github.com/TorchlightSoftware/mongo-watch</a>) in my todo list application to listen to a changes to a mongodb collection. Now my question is where do I declare the watcher? In the controller? App.js? And what do I have to set"selection" and "idSet" to in order to just listen to insert events? I'm also using Angular.</p>
  
  <pre><code>var MongoWatch, watcher;
  
  MongoWatch = require('mongo-watch');
  
  watcher = new MongoWatch({
    format: 'pretty'
  });
  
  watcher.query({
    collName: collName,
    selection: selection,
    idSet: idSet
  
  }, function(err, query) {
  
    query.on('data', function(event) {
      console.log('something changed:', event);
    });
  });
  </code></pre>
  
  <p>Any guidance would be appreciated!</p>
  
  <p>Thanks!</p>