Core
API v2.x
2

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 #

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

Other protocols #

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

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