[SERVER-67027] Applying more than one search predicate on a Multi Key Indexed field. Created: 05/Jun/22 Updated: 27/Oct/23 Resolved: 08/Jun/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.4.13 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Yomi SEa | Assignee: | Backlog - Triage Team |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | query-parser | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Server Triage
|
|||||||||||||
| Operating System: | ALL | |||||||||||||
| Steps To Reproduce: | Sample Data:
Query: constantly false condition, a number can't be less than and greater than itself.
Expected Result:
Actual Result :
Fixed Query: a sample query that looks like has the expected behavior.
|
|||||||||||||
| Participants: |
| Description |
|
Querying on an array of nested documents will split each search condition and apply them separately to the documents in the array.
|
| Comments |
| Comment by Eric Sedor [ 08/Jun/22 ] |
|
This is as expected based on the behavior of multikey index bounds. When you want to apply multiple criteria to a single element of an array, you must use $elemMatch. If you have additional questions about this behavior or other questions about the queries for your use-case, we recommend starting with the MongoDB Developer Community Forums. Thank you! |