[DOCS-592] shardcollection synax is incorrect Created: 09/Oct/12  Updated: 30/Oct/23  Resolved: 09/Oct/12

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Minor - P4
Reporter: Gregor Macadam Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 11 years, 19 weeks, 1 day ago

 Description   

http://docs.mongodb.org/manual/reference/command/shardCollection/

command syntax is list as

{ shardcollection: "<db>.<collection>", key: "<shardkey>" }

however

key :

{ "<shardkey>" : 1 }

is correct syntax

mongos> db.runCommand(

{shardcollection: "test.bar2" , key : "key"}

)

{ "ok" : 0, "errmsg" : "no shard key" }

mongos> db.runCommand({shardcollection: "test.bar2" , key :

{ "key": 1}

})

{ "collectionsharded" : "test.bar2", "ok" : 1 }

mongos>



 Comments   
Comment by auto [ 09/Oct/12 ]

Author:

{u'date': u'2012-10-09T07:17:41-07:00', u'email': u'samk@10gen.com', u'name': u'Sam Kleinman'}

Message: DOCS-592: correcting shardcollection page.
Branch: master
https://github.com/mongodb/docs/commit/e538e4d84e18a9494c56588422adf31367b7f60d

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