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 #

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

Other protocols #

{
  "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.

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