$gte doesn't match whole arrays but equality does

XMLWordPrintableJSON

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

      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
              Reporter:
              Mathias Stearn
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: