Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-230

$in operator to recognise and obey DBRefs

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Trivial - P5 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.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            digitala Phillip Oldham
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: