mongoose count document based on value code example Example: mongoose count model.estimatedDocumentCount();