Skip to content

Latest commit

 

History

History
78 lines (59 loc) · 1.21 KB

File metadata and controls

78 lines (59 loc) · 1.21 KB
code type title
true
page
msetnx

msetnx

Sets the provided keys to their respective values, only if they do not exist. If a key exists, then the whole operation is aborted and no key is set.

[Redis documentation]


Query Syntax

HTTP

URL: http://kuzzle:7512/ms/_msetnx
Method: POST
Body:
{
  "entries": [
    {"key": "<key1>", "value": "<value1>"},
    {"key": "<key2>", "value": "<value2>"},
    {"key": "...", "value": "..."}
  ]
}

Other protocols

{
  "controller": "ms",
  "action": "msetnx",
  "body": {
    "entries": [
      {"key": "<key1>", "value": "<value1>"},
      {"key": "<key2>", "value": "<value2>"},
      {"key": "...", "value": "..."}
    ]
  }
}

Body properties

  • entries: an array of objects. Each object describes a new key-value pair to set, using the following properties:
    • key: key identifier
    • value: new value

Response

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

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