SpringSource/spring-data-mongodb — pull request #36 by heroldus (2013-04-24 10:58:24+00:00)
Title: DATAMONGO-586 extract AggregationOperation

We already use MongoDBs aggregation framework in our yum-repo-server ( https://github.com/immobilienscout24/yum-repo-server ) and want to reuse single operations of the pipeline to apply them with other filtern for exmaple. The current implementation of the ```AggregationPipeline``` doesn't support such reusage. Therefore I extracted an ```AggrationOperation``` interface and implemented the ```MatchOperation``` and ```GroupOperation```.

Now, you are able to write the pipeline operations more fluent:

```java
mongoTemplate.aggregate("collectionName", SomeEntity.class,
match(where("key").is("value")),
group(idField("someId")).count("count").push("valueList", "listField"),
match(where("count").gt(3))
);
```

If you like that scheme, I can implement some of the other pipeline operations as well and add some tests.