var st = new ShardingTest({
other: {
rs: true,
rsOptions: {nodes: 2}
}
});
var mongos = st.s0;
var coll = mongos.getCollection('foo.bar');
var shardAdmin = st.shard0.getDB('admin');
mongosAdmin.runCommand({
enableSharding: coll.getDB().getName()
});
mongosAdmin.runCommand({
shardCollection: coll.getFullName(),
key: {_id: 1}
});
assert.commandFailed(shardAdmin.runCommand({
cleanupOrphaned: coll.getFullName(),
startingFromKey: {someKey: 'someValue', someOtherKey: 1}
}));
assert.commandFailed(shardAdmin.runCommand({
cleanupOrphaned: coll.getFullName(),
startingFromKey: {someKey: 'someValue'}
}));