title: MongoDB watch() to observe change in Database with NodeJS and Mongoose
body: <p>I am trying to watch my mongodb. whenever a change occurs I want to apply an action. This is what I have tried </p>
  
  <pre><code>var mongoose = require('mongoose');
  //mongoose.connect('mongodb://localhost/test');
  mongoose.Promise = global.Promise
  mongoose.connect('mongodb://localhost:27017')
  mongoose.connection.createCollection('people');
  const Person = mongoose.model('Person', new mongoose.Schema({ name: String }));
  Person.watch().
      on('change', data =&gt; console.log(new Date(), data));
  console.log(new Date(), 'Inserting doc');
  Person.create({ name: 'john doe' });
  
  console.log(new Date(), 'Inserted doc');
  </code></pre>
  
  <p>But I am getting the following error </p>
  
  <blockquote>
    <p>node_modules/mongodb/lib/utils.js:132
          throw err;
          ^</p>
    
    <p>MongoError: $changeStream may not be opened on the internal admin
    database</p>
  </blockquote>
  
  <p>How can I fix this ? </p>