(function() {
|
"use strict";
|
|
db.c.drop();
|
assert.commandWorked(db.c.insert({a: {b: -1}}));
|
assert.commandWorked(db.c.insert({a: {b: 1}}));
|
|
let result = assert.commandWorked(db.runCommand({
|
aggregate: "c",
|
pipeline: [],
|
exchange: {
|
policy: "range",
|
consumers: NumberInt(2),
|
bufferSize: NumberInt(1024),
|
key: {"a.b": 1},
|
boundaries: [{"a.b": MinKey}, {"a.b": 0}, {"a.b": MaxKey}],
|
consumerids: [NumberInt(0), NumberInt(1)]
|
},
|
cursor: {batchSize: 0}
|
}));
|
assert.eq(result.cursors.length, 2);
|
assert.eq(result.cursors[0].ok, true);
|
assert.eq(result.cursors[1].ok, true);
|
let firstCursorId = result.cursors[0].cursor.id;
|
let secondCursorId = result.cursors[1].cursor.id;
|
|
let firstGetMore =
|
assert.commandWorked(db.runCommand({getMore: firstCursorId, collection: "c"}));
|
printjson(firstGetMore);
|
|
let secondGetMore =
|
assert.commandWorked(db.runCommand({getMore: secondCursorId, collection: "c"}));
|
printjson(secondGetMore);
|
}());
|