Create a shard key

Creates one or more shard keys for a specified collection.

Path parameters

collection_namestringRequired
Name of the collection to create shards for

Headers

api-keystringRequired

Query parameters

timeoutintegerOptional

Wait for operation commit timeout in seconds. If timeout is reached - request will return with service error.

Request

This endpoint expects an object.
shard_keystring or uint64Required
shards_numberuintOptional
How many shards to create for this key If not specified, will use the default value from config
replication_factoruintOptional
How many replicas to create for each shard If not specified, will use the default value from config
placementlist of uint64sOptional
Placement of shards for this key List of peer ids, that can be used to place shards for this key If not specified, will be randomly placed among all peers

Response

successful operation
usageobject or anyOptional
timedoubleOptional
Time spent to process this request
statusstringOptional
resultbooleanOptional