Skip to content

anantsrivast/mongodb-aggregate-query-support

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Release Version License

MONGO DB AGGREGATE QUERY SUPPORT

This module provides annotated support for MongoDB aggregate queries much like the @Query annotation provided by the Spring Data module.

The @Query annotation provided by Spring Data MongoDb allows queries to be executed with minimum code being written.
It is highly desirable to have a similar mechanism for MongoDB aggregate queries which allow us to execute sophisticated queries with practically no code being written.

Current Limitations

Not all aggregate pipeline steps are supported. As of 0.7.2 support is provided for

  • Project
  • Unwind
  • Lookup
  • Group
  • Match
  • Out
  • Limit
  • Bucket (Mongo 3.4+) - added in v0.7.2
  • AddFields (Mongo 3.4+) - added in v0.7.2
  • ReplaceRoot (Mongo 3.4+) - added in v0.7.2

Minimum Java version supported is 1.8

Usage

See the unit test classes and test repository definitions for examples of how to use the Aggregate query annotations.

The @Aggregate annotation is used identically to the way the Spring data @Query annotation is used. You can put the annotation on any interface method (with placeholders) to get Aggregate query support. The easiest way to do this is to test the pipeline on a MongoDB client (like RoboMongo or MongoChef) and then copy the pipeline steps into each annotation.

Contributors

  • Kollivakkam Raghavan (owner)
  • Sukhdev Singh
  • Cameron Javier

About

Spring Data like MongoDB Aggregate Query Support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%