I am trying to count all Documents in a Collection but I just get 'undefined '.
I searched in Mongoose Documentation but the only example that I have is this :
users.count(query , function(err, result){
if(err) ...
// count is the result
var count = result
});
So, in Mongoose Documentation I can count the number of documents that match a query passed in the function, but
How can I count all the Documents in a Collection? All without any query?
In Mongoose terminal I can just do :
db.CollectionName.count()
Does someone know how to do it using Mongoose?
Thank you.