suppose I have the following datastructure:
var user = {_id: \'foo\', age: 35}; var post = {_id: \'...\', author: {$ref: user, $id: \'foo\'},...};
This db.post.find('author.$id': 'foo') has missing the {}, so the correct sentence is:
db.post.find('author.$id': 'foo')
{}
db.post.find({'author.$id': 'foo'})
Also this can be achieved with:
db.post.find({'author': DBRef("user", ObjectId('foo'))})
But is more compact and practical the first way.