[SERVER-3337] $all with an empty array should return all documents rather than no documents Created: 26/Jun/11 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Moses Nakamura | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | logic, query-44-grooming | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Execution
|
||||||||
| Participants: | |||||||||
| Description |
|
$all doesn't work as expected on lists The logic of all seems to be: However, for the empty list, which would vacuously satisfy everything, it does not return everything. |
| Comments |
| Comment by Asya Kamsky [ 15/Mar/22 ] |
|
Since $in:[] returns nothing, I don't see how $all can behave differently... |
| Comment by David Storch [ 12/Jul/19 ] |
|
The behavior of {$all: []} matching nothing has been in place for a long time, possibly since |
| Comment by Jason R. Coombs [ 23/Mar/14 ] |
|
I concur. Rather than raise an error, MongoDB should accept the empty list and treat it just like a list of empty queries. |