db.collection.count() (mongosh method) - Database Manual - MongoDB Docs
The count method is deprecated and should be replaced by the countDocuments or estimatedDocumentCount method