The mongoDB deprecating COUNT() because of several reason and they recommeded to use countDocument() and estimatedDocumentCount(), few reason which i found is :
Inconsistent Results: count() can return inaccurate counts if it's used without a query predicate on collections with sharded clusters. This can lead to misleading results, especially in distributed systems where data changes frequently.
Performance Overhead: In large collections, count() can be slow and resource-intensive because it does not optimize for specific query filters and can perform a full collection scan. In contrast, countDocuments() is optimized for filtered counts and works well with indexes.
Concurrency and Locking Issues: When count() is used on collections with heavy write traffic, it can lead to performance bottlenecks due to locking issues, as it may need to access the entire dataset