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

$in does not work with nested arrays

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.3.5
    • Component/s: None
    • None
    • Environment:
      32-bit 1.3.5 in staging/test environment

      I have some documents for which I'd like to use composite fields. Something like:

      {id:['x', 1], value:1234}

      and

      {id:['y', 2], value:4321}

      .

      The idea is that I can pull both of those docs by saying:

      db.clxn.find({id:{$in:[['x', 1], ['y', 2]]}}).

      That would let me select just those two in a single query. It doesn't work though. I get no results back using both the JS console and Pymongo.

      This can't be solved by making each component of the composite field into separate fields either. If they were individual fields id_str and id_int and I did:

      db.clxn.find({id_str:{$in:['x', 'y']}, id_int:{$in:[1,2]}})

      I might get back up to 4 documents.

            Assignee:
            Unassigned Unassigned
            Reporter:
            dowski Christian Wyglendowski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: