Details
-
Improvement
-
Resolution: Won't Fix
-
Trivial - P5
-
None
-
0.9.7
-
None
-
Query
Description
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.