Core
API v2.x
2

renamenx #

Renames a key, only if the new name is not already used.

[Redis documentation]


Query Syntax #

HTTP #

URL: http://kuzzle:7512/ms/_renamenx/<_id>
Method: POST
Body:
{
  "newkey": "<new key name>"
}

Other protocols #

{
  "controller": "ms",
  "action": "renamenx",
  "_id": "<key>",
  "body": {
    "newkey": "<new key name>"
  }
}

Argument #

  • _id: key identifier

Body properties #

  • newkey: the new key name

Response #

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

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