Naytokai
Naytokai

Reputation: 3

Aggregation $addFields Mongo Morphia equivalent

I want to use this below mongo query in morphia but cannot find $addFields morphia equivalent in morphia 1.3.2

db.getCollection('user').aggregate([
  { $addFields: {
    fullName: {
      $concat: ['$firstname',' ','$lastname']
    }
  }}
])

Then I match this query with : aggregation.match(mongoQuery)

Can someone help ?

Upvotes: 0

Views: 267

Answers (1)

evanchooly
evanchooly

Reputation: 6243

Aggregation support is pretty limited in 1.3.2. The API was never fully implemented and was intended as a prototype and never quite finished. However, I have been working to fix that in the upcoming 2.0 version. I hope to do a new, probably, ALPHA release with a preview of the new complete API. If you dont mind playing with snapshot builds you can it now. Instructions for updating your pom are here.

Upvotes: 0

Related Questions