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

$gte doesn't match whole arrays but equality does

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.7, 2.5.3
    • Component/s: Querying

      This seems like an inconsistency. I'd assume that {a: {$gte: X}} should return a superset of {a: X} for all values of X. However this doesn't hold for arrays:

      > db.z.drop()
      true
      > db.z.insert({a:[1,2]})
      > db.z.find({a:[1,2]})
      { "_id" : ObjectId("526aa2fad081e73cd00ecfd9"), "a" : [  1,  2 ] }
      > db.z.find({a:{$gte:[1,2]}})
      > 
      

            Assignee:
            hari.khalsa@10gen.com hari.khalsa@10gen.com
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: