I work with a lot of data in MongoDB. And I got a problem with performance while I worked with count. I even wrote some tests to demonstrate a difference between count that used aggregation and estimated_document_count that used metadata of collection to return the estimated count. My proposal is to add estimated_document_count implementation to the library. If you think this is a good idea, let me know and I send you PR as soon as possible.
P.S. I ran these tests only on my working machine, and I know that depending on hardware these tests result will be different, but the general point of this issue will be the same
I work with a lot of data in MongoDB. And I got a problem with performance while I worked with count. I even wrote some tests to demonstrate a difference between count that used aggregation and estimated_document_count that used metadata of collection to return the estimated count. My proposal is to add estimated_document_count implementation to the library. If you think this is a good idea, let me know and I send you PR as soon as possible.
My tests
Results of testing
P.S. I ran these tests only on my working machine, and I know that depending on hardware these tests result will be different, but the general point of this issue will be the same