[DOCS-744] moveChunk command contains error on find parameter Created: 13/Nov/12  Updated: 30/Oct/23  Resolved: 13/Nov/12

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: mongodb-2.2
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Thomas Rueckstiess Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:
Days since reply: 11 years, 14 weeks, 1 day ago

 Description   

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.



 Comments   
Comment by Sam Kleinman (Inactive) [ 13/Nov/12 ]

the following change has been published: https://github.com/mongodb/docs/commit/759748029411a63acc689e398c8dfe6b65d9b133

Comment by Thomas Rueckstiess [ 13/Nov/12 ]

It also needs to be changed at these links:

Generated at Thu Feb 08 07:39:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.