Closed dv2018f closed 1 week ago
I'm not entirely sure I understand what you want to achieve given MongoOperations
has dedicated methods like estimatedCount
to operate upon collection statistics. Additionally you could call MongoTemplate#useEstimatedCount(...)
to apply a different count strategy.
Further more the snippet from the description refers to the MongoDB client API of MongoCollectionImpl
which is maintained by the java drivers team at MongoDB. Please report issues/enhancements with them here.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
Upon reviewing the source code, it was found that MongoTemplate executes the count method. The underlying default is AGGREGATE. Can we specify it as the COMMAND policy, as aggregate takes longer to scan public long countDocuments(Bson filter, CountOptions options) { return this.executeCount((ClientSession)null, filter, options, CountStrategy.AGGREGATE); }