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

$elemMatch/$all behavior in version 2.6.1

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.6.4, 2.7.5
    • Component/s: Querying
    • None
    • ALL

      I have created an db with the following structure

      {
      "_id" : ObjectId("54167c9a4420660b672d2a3f"),
      "a" : "1111",
      "pc" : [
          [
              "bb",
              "aa",
              {
                  "c" : "cc",
                  "d" : "dd"
              },
              {
                  "c" : "aaa",
                  "d" : "ddd"
              },
      
          ],
          [
              "cc",
              "dd",
              {
                  "a" : "cc",
                  "b" : "dd"
              },
              {
                  "a" : "aaa",
                  "b" : "ddd"
              },
                          }
           ]
        ]
      }
      

      and i have used the following query in mongodb version 2.4.6, it has given the correct output

       db.cg.find({'pc':{'$elemMatch':{'$all':['aa','bb']}}})
      

      but the same query i have used in mongodb version 2.6.1 it is neither throwing any error nor giving any result

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            krishna114 krishna
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: