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

Support combining $in and $all on a single field

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Querying
    • None

    Description

      > db.test.insert(

      {a:[2,3,4,5]}

      )
      > db.test.findOne({a: {$in:[1,2]}})
      {
      "_id" : ObjectId("4bb9b60dccf9c6e519c4d1fd"),
      "a" : [
      2,
      3,
      4,
      5
      ]
      }
      > db.test.findOne({a: {$all:[3,4]}})
      {
      "_id" : ObjectId("4bb9b60dccf9c6e519c4d1fd"),
      "a" : [
      2,
      3,
      4,
      5
      ]
      }
      > db.test.findOne({a: {$in:[1,2], $all: [3,4]}})
      null

      Attachments

        Activity

          People

            aaron Aaron Staple
            mathias@mongodb.com Mathias Stearn
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: