Search in sources :

Example 1 with GroupBy

use of org.springframework.data.mongodb.core.mapreduce.GroupBy in project spring-data-mongodb by spring-projects.

the class GroupByTests method singleKeyCreation.

@Test
public void singleKeyCreation() {
    Document gc = new GroupBy("a").getGroupByObject();
    assertThat(gc, is(Document.parse("{ \"key\" : { \"a\" : 1} , \"$reduce\" :  null  , \"initial\" :  null }")));
}
Also used : GroupBy(org.springframework.data.mongodb.core.mapreduce.GroupBy) Document(org.bson.Document) Test(org.junit.Test)

Aggregations

Document (org.bson.Document)1 Test (org.junit.Test)1 GroupBy (org.springframework.data.mongodb.core.mapreduce.GroupBy)1