suppose I have the following datastructure:
var user = {_id: \'foo\', age: 35}; var post = {_id: \'...\', author: {$ref: user, $id: \'foo\'},...};
Got it:
db.post.find({'author.$id': 'foo'})