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

$elemMatch on subArray

    XMLWordPrintableJSON

Details

    • Minor Change
    • ALL

    Description

      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}}}}) 
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: