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

$elemMatch on subArray

    • Minor Change
    • ALL

      Here a test-case:

      > db.test.insert({"field": [[100,300],[100, 110]]}) 
      > db.test.findOne() 
      { 
              "_id" : ObjectId("4c1f229882c620b16f0d3fbd"), 
              "field" : [ 
                      [ 
                              100, 
                              300 
                      ], 
                      [ 
                              100, 
                              110 
                      ] 
              ] 
      }
      

      These two commands should find this element but they don't:

      > db.test.find({"field": {$elemMatch: {0: 100, 1:300}}}) 
      > db.test.find({"field": {$elemMatch: {0: {$gt: 1}, 1: {$gt: 1}}}}) 
      

            Assignee:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Reporter:
            trikko Andrea Fontana
            Votes:
            12 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              Resolved: