TEST_F(QueryPlannerTest, ContainedOrPathLevelMultikeyCannotCompoundFields) {
    MultikeyPaths multikeyPaths1{{0U}, {0U}};
    MultikeyPaths multikeyPaths2{{0U}};
    addIndex(BSON("a.b" << 1 << "a.c" << 1), multikeyPaths1);
    addIndex(BSON("a.d" << 1), multikeyPaths2);

    runQuery(fromjson(
        "{$and: [{a: {$elemMatch: {b: 5}}}, {a: {$elemMatch: {$or: [{c: 6}, {d: 7}]}}}]}"));
    assertNumSolutions(2);
    assertSolutionExists(
        "{fetch: {filter: {$and: [{a: {$elemMatch: {b: 5}}}, {a: {$elemMatch: {$or: [{c: 6}, {d: "
        "7}]}}}]}, node: "
        "{ixscan: {pattern: {'a.b': 1, 'a.c': 1}, bounds: {'a.b': [[5, 5, true, true]], 'a.c': "
        "[['MinKey', 'MaxKey', true, true]]}}}"
        "}}");
    assertSolutionExists("{cscan: {dir: 1}}}}");
}
TEST_F(QueryPlannerTest, ContainedOrPathLevelMultikeyCannotCompoundFields) {
    MultikeyPaths multikeyPaths1{{0U}, {0U}};
    MultikeyPaths multikeyPaths2{{0U}};
    addIndex(BSON("a.b" << 1 << "a.c" << 1), multikeyPaths1);
    addIndex(BSON("a.d" << 1), multikeyPaths2);

    runQuery(fromjson(
        "{$and: [{a: {$elemMatch: {b: 5}}}, {a: {$elemMatch: {$or: [{c: 6}, {d: 7}]}}}]}"));
    assertNumSolutions(2);
    assertSolutionExists(
        "{fetch: {filter: {$and: [{a: {$elemMatch: {b: 5}}}, {a: {$elemMatch: {$or: [{c: 6}, {d: "
        "7}]}}}]}, node: "
        "{ixscan: {pattern: {'a.b': 1, 'a.c': 1}, bounds: {'a.b': [[5, 5, true, true]], 'a.c': "
        "[['MinKey', 'MaxKey', true, true]]}}}"
        "}}");
    assertSolutionExists("{cscan: {dir: 1}}}}");
}