db.collection.count() - Database Manual v8.0 - MongoDB Docs

The count method is deprecated and should be replaced by the countDocuments or estimatedDocumentCount method