Distributed

Create a shard key

PUT
Creates one or more shard keys for a specified collection.

Path parameters

collection_namestringRequired
Name of the collection to create shards for

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_key
unionRequired
shards_number
integerOptional
How many shards to create for this key If not specified, will use the default value from config
replication_factor
integerOptional
How many replicas to create for each shard If not specified, will use the default value from config
placement
list of integersOptional
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

This endpoint returns an object
time
doubleOptional
Time spent to process this request
status
stringOptional
result
booleanOptional
PUT
1curl -X PUT http://localhost:6333/collections/collection_name/shards \
2 -H "api-key: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "shard_key": "shard_key"
6}'
200Updated
1{
2 "time": 1.1,
3 "status": "status",
4 "result": true
5}