suppose I have the following datastructure:
var user = {_id: \'foo\', age: 35}; var post = {_id: \'...\', author: {$ref: user, $id: \'foo\'},...};
For anyone looking for a Java solution to this then if you are using mongojack its really easy:
collection.find(DBQuery.is("user", new DBRef(user.getId(), User.class)));
Where collection is a JacksonDBCollection.