Core
API v2.x
2

getset #

Sets a new value for a key, and returns its previously stored value.

[Redis documentation]


Query Syntax #

HTTP #

URL: http://kuzzle:7512/ms/_getset/<_id>
Method: POST
Body:
{
  "value": "new key value"
}

Other protocols #

{
  "controller": "ms",
  "action": "getset",
  "_id": "<key>",
  "body": {
    "value": "new key value"
  }
}

Arguments #

  • _id: key to get and set

Body properties #

  • value: the new key value

Response #

Returns the previously stored value.

{
  "requestId": "<unique request identifier>",
  "status": 200,
  "error": null,
  "controller": "ms",
  "action": "getset",
  "collection": null,
  "index": null,
  "result": "key's previous value"
}