[SERVER-70691] Equality-indexed field cannot use $in in aggregation. Created: 19/Oct/22  Updated: 05/Dec/22  Resolved: 31/Oct/22

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

Type: Bug Priority: Major - P3
Reporter: Davis Haupt (Inactive) Assignee: Backlog - Query Optimization
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-69943 Enable $in in Range Encryption Walker Closed
Assigned Teams:
Query Optimization
Operating System: ALL
Steps To Reproduce:

Schema:

{
    encryptedFields: {
        "fields": [
            {
                path: "age",
                bsonType: "int",
                queries: {queryType: "range", min: NumberInt(0), max: NumberInt(255), sparsity: 1}
            },
            {path: "zipcode", bsonType: "string", "queries": {"queryType": "equality"}},
        ]
    }
}

Query:

{
    $and: [
        {$gte: ["$age", NumberInt(22)]},
        {$lt: ["$age", NumberInt(25)]},
        {$in: ["$zipcode", ["098765", "ABCDE", "1257"]]}
    ]
}

Sprint: QO 2022-10-31
Participants:

 Description   

Query analysis seems overly eager and errors when $in is used, even with an equality index, failing with the error: "ExpressionIn with RangeIndex not yet supported". The range intender should check if the field being operated on is indexed with range before asserting.


Generated at Thu Feb 08 06:16:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.