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

$gte doesn't match whole arrays but equality does

    XMLWordPrintable

    Details

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

      Description

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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: