I am trying to find out number of collections in model and use that number for calculation.
This is what I have
var gcount=Shop.count({}, ( err, count)=>{
gcount=count;
});
This doesn’t give any number back.
Please let me know how I can get gcount to give total number of recorded in collection assigned to a variable.