Closed mingfang closed 8 years ago
RESTHeart actually performs the count using the "nativa mongodb version of count()"
see public long getCollectionSize(final DBCollection coll, final Deque<String> filters)
in CollectionDAO
so, in order to add the collection size to the response, it needs to execute two queries:
According there https://softinstigate.atlassian.net/wiki/display/RH/Query+Documents#QueryDocuments-Counting, the count parameter queries the collection, twice. why? The mongodb documentation clearly states that count() does not query at all, https://docs.mongodb.org/v3.0/reference/method/db.collection.count/.
Is there a way to execute the native mongodb version of count()?