Closed phochste closed 3 years ago
estimated_document_count doesn't take a filter argument, it can only give a guesstimate of the whole collection
@nics My mistake..I meant the other way around it is very slow to know the size of a Mongo database and this can be optimized with an estimated_document_count
added estimate_count option to store in 0.0804, can you help test it's effect?
This Catmandu package uses the
count_document
method on Mongo collections to calculate the collection size. This is a very fast operation when no query is provided but a very slow operation on very big MongoDB collections with a query.Provide an optimization flag e.g.
estimate_count => 1
that results in usingestimated_document_count
when a query is provided andcount_document
when no query is provided.