[SERVER-19972] Passing empty array to $in should result in an error Created: 14/Aug/15  Updated: 06/Dec/22  Resolved: 15/Mar/22

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

Type: Improvement Priority: Major - P3
Reporter: Beau Rothrock Assignee: Backlog - Query Optimization
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-41142 Compound index on an array field is n... Backlog
Assigned Teams:
Query Optimization
Participants:

 Description   

Is there a valid case for passing an empty array to the $in query parameter?

This query runs, but, of course, returns no results:

db.enron.find({_id : {$in : []}},{_id:1})

Although syntactically valid it doesn't appear to be semantically valid.



 Comments   
Comment by Asya Kamsky [ 15/Mar/22 ]

Semantically this is valid since the list for $in may be generated programatically.  In addition this would be backwards breaking for all existing applications.

 

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