-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Trivial - P5
-
None
-
Affects Version/s: 0.9.7
-
Component/s: Querying
-
None
-
Query
It would be very useful if the $in operator could recognise and obey DBRefs when querying. For example:
> // excerpt of Account document > { users : [ { "$ref": "users", "$id": 11 }, { "$ref": "users", "$id": 20 }, { "$ref": "customers", "$id": 7 } ] } > // get account > var account = db.accounts.findOne( ... ) > // get all users at once > db.users.find( { _id : { $in : account.users });
Which returns back {user 11} and {user 20}, but not {user 7} because it's actually a "customer" collection reference.