Key Value

Set one or more key-value pairs in key-value collection

Set one or more key-value pairs in key-value collection.

If the input is an array of objects, then key-value pairs are created in a batch.

If the key does not exist, then the key-value pairs are created. Otherwise, the entry for the key is updated.

Specify expiration in UTC timestamp.

Note that you can use this API for both normal (text) and blob KV collections. When setting blob data in a blob collection, specify the multipart/form-data as the content type for the request body, and provide multi-part data in the request body.

put/_fabric/{fabric}/_api/kv/{collection}/value

Request

Path parameters

fabricstring string required

The name of the fabric.

collectionstring string required

The name of the key-value collection

Request body

_keystring required

Key

valuestring required

Value

groupIDstring

Group ID

expireAtinteger

Expiry time in UTC timestamp format.

Example request

[
  {
    "_key": "foo",
    "value": "bar",
    "groupID": "group-1"
  }
]

Response

Successfully updated key-value pair.

_idstring

ID of the collection.

_keystring

_key details of collection.

_revstring

updated _rev details of collection.

_oldrevstring

prvious _rev details of collection.

Example response

[
  {
    "_id": "test/foo",
    "_key": "foo",
    "_rev": "_dPSbTGC---",
    "_oldrev": "_dPRuHxe--_"
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.