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

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