Skip to main content

KV_CLEAR_SET

Removes all keys and set new keys in a single command.

This command is an alternative to sending separate KV_CLEAR and KV_SET requests.

ParamTypeMeaningRequired
keysobjectKeys and values to store, same structure as keys in KV_SETY

Response

KV_CLEAR_SET_RSP

ParamTypeMeaning
stunsigned intStatus of the clear operation
cntunsigned intNumber of keys deleted during clear.
If there was an error during the clear, cnt is 0.

The status (st) can be either:

  • Ok
  • Unknown

Example

Clear and set new keys
{
"KV_CLEAR_SET":
{
"keys":
{
"username":"The Rock",
"movieNames":["Jumanji","Hercules"],
"yearBorn":1972
}
}
}

Response:

Response includes status for each key set
{
"KV_CLEAR_SET_RSP":
{
"st": 1,
"cnt": 2
}
}