I am beating my head on the table for too long with this one...
I have two MongoDB collections: \"chatroom\" and \"users\". The \"chatroom\" collection has \"user_id
To answer my own question, I went around the problem by making "user_id" an instance of a "MongoId" class instead of a plain string. Basically, I store "user_id" as:
$mongoObject["user_id"] = new MongoId($this->user_id);
Another solution would probably be decorating the objects with "uid" field with a value equal to "_id.$id".