|
The tests jstests/core/stages_ixscan.js and jstests/core/stages_mergesort.js also have duplicate keys in the object literals they construct.
// 20 <= foo <= 30
|
// baz == 25 (in index so we can match against it.)
|
ixscan1 = {ixscan: {args:{keyPattern:{foo:1, baz: 1},
|
startKey: {"": 20, "":MinKey},
|
endKey: {"" : 30, "":MaxKey}, endKeyInclusive: true,
|
direction: 1},
|
filter: {baz: 25}}};
|
res = db.runCommand({stageDebug: {collection: collname, plan: ixscan1}});
|
assert.eq(res.ok, 1);
|
assert.eq(res.results.length, 1);
|
However, fixing these tests (and preserving their intent) requires changing the stageDebug command to accept startKey and endKey as arrays. The mongo shell has no way to guarantee an order for object keys, so using stripFieldNames() is not an effective solution. Enabling the mongo shell to query using ranges of a compound index with the stageDebug command will be done separately.
|