|
On the moveChunk page, the find parameter is explained as
find – A query expression that will select a document within the chunk you wish to move. The query need not specify the shard key.
But if I try specifying a find query that does not include the shard key, I get an error:
mongos> db.adminCommand({moveChunk:"test.docs", find: {a:true}, to: "shard0001"})
|
{
|
"errmsg" : "exception: right object ({}) doesn't have full shard key ({ shardkey: 1.0 })",
|
"code" : 10199,
|
"ok" : 0
|
}
|
Discussing with scotthernandez, this description is wrong. The query must include the shard key.
Another part that's confusing: The document to match the find query doesn't actually have to exist. The find query just needs to match a potential document that would reside in that shard.
|