Package org.mongojack.aggregation

Examples of org.mongojack.aggregation.ProjectAggregation


        coll.insert(new MockObject("bar", 101));
        coll.insert(new MockObject("bar", 102));

        AggregationBuilder<MockObjectAggregationResult> builder = new AggregationBuilder<MockObjectAggregationResult>();
        builder.group(new GroupAggregation("string").withSum("integer", "integer"))
                .project(new ProjectAggregation().set("integer", "string"));

        AggregationResult<MockObjectAggregationResult> aggregationResult = coll.aggregate(builder.build(MockObjectAggregationResult.class));

        Assert.assertEquals(2, aggregationResult.results().size());
        Assert.assertEquals("203", aggregationResult.results().get(0).string);
View Full Code Here

TOP

Related Classes of org.mongojack.aggregation.ProjectAggregation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.