title: How to get Mongoose to list all documents in the collection? To tell if the collection is empty?
body: <p>I'm using a MEAN stack and writing these methods in Mongoose. I'm wondering what's wrong with what I put in the Mongoose model file. I would like to use Mongoose to simply print out a list all the documents in the myModel collection.</p>
  
  <pre><code>myModel.methods.myMethod = function(cb){
    this.model("Bids").find({}, 'myField', function(err, results){
      if (err){console.log(err);return err;}
      console.log("okay");
      console.log(results);
    })
    this.save(cb);
  }
  </code></pre>
  
  <p>Also, what is the code that I can write in Mongoose to tell if the myModel collection is empty or not?</p>
  
  <hr>
  
  <p>It's better to teach a man how to fish than to give him a fish ... </p>
  
  <p>So it would be extremely helpful if you can suggest what debugging tools I can install, such as an Express middleware, that can help me debug myself. <a href="https://stackoverflow.com/q/33026850/4825465">Please post your debugging suggestions here</a>.</p>