[SERVER-31073] Query with $in and $lt Created: 13/Sep/17  Updated: 27/Oct/23  Resolved: 22/Sep/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Saravanan Kuppusamy Assignee: Mark Agarunov
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Macintosh


Participants:

 Description   

Hi,

I am trying to execute the below query, it does not find result.

db.users.find({ "_id" : "abc", "SYS_PERM" : { "$in" : [{ "_ANY_" : { "$lt" : 3 } }, { "_ALL_" : { "$lt" : 3 } }] } })

It looks $lt operator doesn't work inside of $in operator. The same work if I remove the $lt as follows.

db.users.find({ "_id" : "abc", "SYS_PERM" : { "$in" : [{ "_ANY_" : 1 }, { "_ALL_" : 1 }] } })

Is this the current known limitation in MongoDB?



 Comments   
Comment by Mark Agarunov [ 14/Sep/17 ]

Hello sarankup,

Thanks for your report. Looking over the description you've provided, I do not see anything to indicate a bug in the MongoDB server. The $in operator checks for equivalence in an array and does not support the nested $lt.

Please note that SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-user group.

Thanks,
Mark

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