I'm trying to get information from my meteor mongo database and display it as a json on my web page but i get an error `TypeError: Cannot read property 'find' of undefined` and i don't know why. 

```
var MongoClient = require('mongodb').MongoClient;
var db;
// Initialize connection once
MongoClient.connect("mongodb://localhost:3001", function(err, database) {
if(err) //console.log(err);
console.log(database);
  db = database;
  // Start the application after the database connection is ready
  app.listen(3001);
  console.log("Listening on port 3000");
});

// middleware to use for all requests
router.use(function (req, res, next) {
  // do logging
  //console.log('Something is happening.');
  next(); // make sure we go to the next routes and don't stop here
});
router.route('/subscribers')
  app.get("/api/subscribers", function (req, res) {

    db.subs.find({}, function(err, docs) {
      docs.each(function(err, doc) {
        if(doc) {
          res.json(doc);
        }
        else {
          res.end();
        }

      });
    });
  });

```