I want to get an object based on the id (or another separate field) of an object that is nested 2 levels from the object I want to get. Demo example:
I want to find all blog posts that have been commented on by a specific user.
Blog List<Comment> ignoredField1 ignoredField2 User id name ignoredField3
Comments and users @Referenced by their parent objects.
After reading this post http://groups.google.com/group/morphia/browse_thread/thread/57090ef1bd2f3e74?pli=1
I understand how to find blogs with comments, where ignoredField1 / 2 has a certain meaning, but I want to navigate further.
I tried the following, but since all comment fields are compared, there is no match
q.field("comments").hasThisElement(new Comment(new User("name")));
source share