Skip to content

MongoTemplate.count Specify strategy #4727

@dv2018f

Description

@dv2018f

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions