[SERVER-11377] $gte doesn't match whole arrays but equality does Created: 25/Oct/13  Updated: 10/Dec/14  Resolved: 15/Nov/13

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.4.7, 2.5.3
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: hari.khalsa@10gen.com
Resolution: Duplicate Votes: 0
Labels: query_triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File server11377.js    
Issue Links:
Duplicate
duplicates SERVER-2841 matcher does not match arrays in ineq... Closed
is duplicated by SERVER-11444 $lt/$lte/$gte/$gt behaves differently... Closed
Related
related to SERVER-11406 Change in behavior on how $gte work w... Closed
Participants:

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


Generated at Thu Feb 08 03:25:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.