Core
API v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

setex #

Sets a value and a time to live (in seconds) on a key. If the key already exists, it is overwritten.

[Redis documentation]


Query Syntax #

HTTP #

Copied to clipboard!
URL: http://kuzzle:7512/ms/_setex/<_id>
Method: POST
Body:
Copied to clipboard!
{
  "value": "<value>",
  "seconds": 60
}

Other protocols #

Copied to clipboard!
{
  "controller": "ms",
  "action": "setex",
  "_id": "<key>",
  "body": {
    "value": "<value>",
    "seconds": 60
  }
}

Argument #

  • _id: key identifier

Body properties #

  • seconds: expiration duration, in seconds
  • value: new key value

Response #

Returns an acknowledgement.

Copied to clipboard!
{
  "requestId": "<unique request identifier>",
  "status": 200,
  "error": null,
  "controller": "ms",
  "action": "setex",
  "collection": null,
  "index": null,
  "result": "OK"
}