Core
API v1.x
1

pexpire #

Sets a timeout (in milliseconds) on a key. After the timeout has expired, the key will automatically be deleted.

[Redis documentation]


Query Syntax #

HTTP #

Copied to clipboard!
URL: http://kuzzle:7512/ms/_pexpire/<_id>
Method: POST
Body:
Copied to clipboard!
{
  "milliseconds": 60000
}

Other protocols #

Copied to clipboard!
{
  "controller": "ms",
  "action": "pexpire",
  "_id": "<key>",
  "body": {
    "milliseconds": 60000
}

Argument #

  • _id: key identifier

Body properties #

  • milliseconds: the number of milliseconds after which the key is deleted

Response #

Returns either 0 (command failed), or 1 (command succeeded).

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