how to retrieve count of a field from mongodb into an object code example Example: mongo count db.collection.countDocuments( <query>, <options> )