diff options
Diffstat (limited to 'jstests/core/stages_mergesort.js')
-rw-r--r-- | jstests/core/stages_mergesort.js | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/jstests/core/stages_mergesort.js b/jstests/core/stages_mergesort.js index 18c52bef40c..5156743078c 100644 --- a/jstests/core/stages_mergesort.js +++ b/jstests/core/stages_mergesort.js @@ -9,22 +9,38 @@ for (var i = 0; i < N; ++i) { t.insert({baz: 1, bar: i}); } -t.ensureIndex({foo: 1, bar:1}); -t.ensureIndex({baz: 1, bar:1}); +t.ensureIndex({foo: 1, bar: 1}); +t.ensureIndex({baz: 1, bar: 1}); // foo == 1 // We would (internally) use "": MinKey and "": MaxKey for the bar index bounds. -ixscan1 = {ixscan: {args:{keyPattern:{foo: 1, bar:1}, - startKey: {foo: 1, bar: 0}, - endKey: {foo: 1, bar: 100000}, endKeyInclusive: true, - direction: 1}}}; +ixscan1 = { + ixscan: { + args: { + keyPattern: {foo: 1, bar: 1}, + startKey: {foo: 1, bar: 0}, + endKey: {foo: 1, bar: 100000}, + endKeyInclusive: true, + direction: 1 + } + } +}; // baz == 1 -ixscan2 = {ixscan: {args:{keyPattern:{baz: 1, bar:1}, - startKey: {baz: 1, bar: 0}, - endKey: {baz: 1, bar: 100000}, endKeyInclusive: true, - direction: 1}}}; +ixscan2 = { + ixscan: { + args: { + keyPattern: {baz: 1, bar: 1}, + startKey: {baz: 1, bar: 0}, + endKey: {baz: 1, bar: 100000}, + endKeyInclusive: true, + direction: 1 + } + } +}; -mergesort = {mergeSort: {args: {nodes: [ixscan1, ixscan2], pattern: {bar: 1}}}}; +mergesort = { + mergeSort: {args: {nodes: [ixscan1, ixscan2], pattern: {bar: 1}}} +}; res = db.runCommand({stageDebug: {plan: mergesort, collection: collname}}); assert.eq(res.ok, 1); assert.eq(res.results.length, 2 * N); |