SyntaxFix
Write A Post
Hire A Developer
Questions
The reason your code doesn't work is because the count function is asynchronous, it doesn't synchronously return a value.
Here's an example of usage:
userModel.count({}, function( err, count){ console.log( "Number of users:", count ); })