Aggregation framework.

124 views
Skip to first unread message

nilesh thete

unread,
Apr 28, 2014, 3:06:44 AM4/28/14
to mongo-jack...@googlegroups.com
Is there any way to use mongodb aggregation, using mongo-jackson?

Thank you,
Nilesh Thete

Luke Palmer

unread,
Apr 28, 2014, 8:25:40 AM4/28/14
to mongo-jack...@googlegroups.com
Yes but only some of the aggregation methods are exposed in the wrapper class.  It should be an easy task if someone wants to contribute a change to add more.

mkr...@trialfire.com

unread,
Apr 29, 2014, 1:14:47 PM4/29/14
to mongo-jack...@googlegroups.com

I've created a significant extension to mongojack so that aggregation works like the rest of mongojack classes (ie fluent builder pattern). For example you could do stuff like this:



       
 AggregationBuilder<SimpleAggregationCount> builder= new AggregationBuilder<SimpleAggregationCount>();
 builder
.match(new MatchAggregation("customerId", "555-555-555"))
 
.group(new GroupAggregation().withCount("count"));
 
AggregationResult<SimpleAggregationCount> aggregationResult = wrappedCollection.aggregate(builder.build(SimpleAggregationCount.class));

I plan to add this to mongojack with a PR but havent gotten around to it. If you're interested I can share my work with you. Let me know...

-Max

wilby yang

unread,
May 20, 2014, 2:24:18 AM5/20/14
to mongo-jack...@googlegroups.com
is there is a way to execute raw mongodb query using mongojack?
Reply all
Reply to author
Forward
0 new messages