Kula
Kula

Reputation: 125

Morphia Aggregation functions

I'm quite new to Morphia. Is there an easy way to make opreations like sum, average, max, min ?

I already saw some "Play" plugin but I'm not sure how it works, and I would like to use plain Morphia.

Upvotes: 0

Views: 4154

Answers (2)

Didac Montero
Didac Montero

Reputation: 2086

Morphia does support aggregate from 0.110. Even if is not documented, here you have some test examples

Upvotes: 0

berus97
berus97

Reputation: 384

You have to use Aggregation pipeline feature of MongoDb with Morphia.

Example of using it, you find on github

https://github.com/mongodb/morphia/blob/master/morphia/src/test/java/org/mongodb/morphia/aggregation/ZipCodeDataSetTest.java

Upvotes: 1

Related Questions