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}
|
});
|
|
// Doesn't match number of keys.
|
assert.commandFailed(shardAdmin.runCommand({
|
cleanupOrphaned: coll.getFullName(),
|
startingFromKey: {someKey: 'someValue', someOtherKey: 1}
|
}));
|
|
// Matches number of keys but not key name. This will succeed but should fail.
|
assert.commandFailed(shardAdmin.runCommand({
|
cleanupOrphaned: coll.getFullName(),
|
startingFromKey: {someKey: 'someValue'}
|
}));
|