I have a mongoose schema. I want to count records in a collection that corresponds to the schema. I don't want to count all records, but records that satisfies some criteria. How to execute this count synchronously?
In mongodb console I can do `db.mycollections.find(criteria).count()". How to execute this query from mongoose code?