setex #
Sets a value and a time to live (in seconds) on a key. If the key already exists, it is overwritten.
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 secondsvalue
: 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"
}
Edit this page on Github(opens new window)