myModel.find({}, function(err, items) {
console.log(items.length); // Big number
});
How can I limit the returned items to only the latest
...additionally make sure to use:
mongoose.Promise = Promise;
This sets the mongoose promise to the native ES6 promise. Without this addition I got:
DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html