Replies: 2 comments 2 replies
-
I somehow managed to miss this for far too long and for that I apologize. It's a year and a half old so I'm going to close it under the notion you've moved past it somehow. If that's not the case, feel free to reopen or open a new discussion and i'll do my best to get you sorted. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey @evanchooly , I am migrating from morphia 1.3.2 to 2.3.9 , I am trying to create query the query seems to be type of Document , |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, unfortunately I have issues in converting a working mongodb query to morphia (java) code and the existing documentation didn't help so far.
Here is the working mongodb query delivering correct results:
Morphia Entity:
And the attempt of converting the query to java code:
Unfortunately the java code delivers entries with null values on the properties. What exactly is missing?
Technically I want the latest statistics (unique by stockExchangeCompany) with latest dateTime per each company (limited to H1 period).
Second question:
In a non-fluent way I'm also able to retrieve the data but how can I retrieve the real object reference when Morphia gives me a DBRef object? I don't want to have a extra call to the db in order to manually resolve DBRef to real object:
EDIT: second question partly resolved via $lookup usage:
new BasicDBObject("$lookup", new BasicDBObject("from", "stock_exchange_companies").append("localField", "stockExchangeCompany.$id").append("foreignField", "_id").append("as", "stockExchangeCompany"))
Is there an elegant Morphia based solution to map a Bson Document directly to the corresponding Entity class?
Right now I use manual getter/setter access and experiment with ModelMapper Framework.
Hope you can help me.
Beta Was this translation helpful? Give feedback.
All reactions