Skip to content

Add support for aggregations via annotated repository methods. [DATAMONGO-2153] #3021

Closed
@spring-projects-issues

Description

@spring-projects-issues

Christoph Strobl opened DATAMONGO-2153 and commented

public interface MyRepo extends MongoRepsitory<...> {

  @Aggregate(pipeline = "{'$group': { _id: '$templateId', maxVersion : { $max : '$version'} } }" )
  MyProjectedType findTemplateWithMaxVersion();

}

The above should be able to load the pipeline from a file, just like the @Query annotation and support placeholders so that one might use input variables within the aggregation


Issue Links:

  • DATAMONGO-2116 Ability to add a comment to an aggregation pipeline
    ("is duplicated by")

Referenced from: pull request #743

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions