There are a couple query planning test cases that specify the correct index bounds but specify field names that don't match the index key pattern. We should amend these test cases and update the QueryPlannerTest fixture to verify that the entire object structure of the IndexBounds matches the query solution specified.
- https://github.com/mongodb/mongo/blob/r3.3.4/src/mongo/db/query/query_planner_array_test.cpp#L1399-L1401
- https://github.com/mongodb/mongo/blob/r3.3.4/src/mongo/db/query/query_planner_collation_test.cpp#L207-L210
TEST_F(QueryPlannerTest, CanCompoundBoundsWhenSharedPrefixIsMultikeyButHasElemMatch) { ... assertSolutionExists( "{fetch: {node: {ixscan: {pattern: {'a.b': 1, 'a.c': 1}, " "bounds: {a: [[2, 2, true, true]], b: [[3, 3, true, true]]}}}}}"); }
TEST_F(QueryPlannerTest, OrQueryCanBeIndexedWhenBothBranchesHaveIndexWithMatchingCollation) { ... assertSolutionExists( "{or: {nodes: [" "{fetch: {node: {ixscan: {pattern: {a: 1}, bounds: {a: [['oof','oof',true,true]]}}}}}," "{fetch: {node: {ixscan: {pattern: {b: 1}, bounds: {a: [['rab','rab',true,true]]}}}}}]}}"); }