Projection usage in new morphia [2.x] #1935
arivazhagan-jeganathan
started this conversation in
General
Replies: 2 comments
-
Can you show me the code you're trying to use? I think I can guess reasonably close but I'd rather not make assumptions if I can help it. Old and new code would be ideal so I can see what you were doing vs how you're trying to do so now. Thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Old Code:
New Code
Help replicate the query built using old code using New Morphia (2.x) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Old morphia, 1.x i could build project pipeline in aggregate query like this:
_id:{fieldA:"text1", "fieldB":"text2} --> this section is built as part of Group pipeline operation.
{"$project": {"_id": "$null", "fieldA": "$_id.fieldA", "fieldB": "$_id.fieldB", "fieldC": 1}}]
How do build a similar Projection query with new Morphia (2.x)?
with code like
project(Projection.project().include("_id").include("fieldA").include("fieldB").include("fieldC")) -->
Unable to build a customized project pipeline as explained above. Kindly suggest a way to do this.
Beta Was this translation helpful? Give feedback.
All reactions