hsetnx #
Sets a field and its value in a hash, only if the field does not already exist.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/ms/_hsetnx/<_id>
Method: POST
Body:
{
"field": "<field name>",
"value": "<field value>"
}
Other protocols #
{
"controller": "ms",
"action": "hsetnx",
"_id": "<key>",
"body": {
"field": "<field name>",
"value": "<field value>"
}
}
Arguments #
_id
: hash key identifier
Body properties #
field
: new hash field namevalue
: hash field value
Response #
Returns either 0
(command failed), or 1
(command succeeded).
{
"requestId": "<unique request identifier>",
"status": 200,
"error": null,
"controller": "ms",
"action": "hsetnx",
"collection": null,
"index": null,
"result": 1
}
Edit this page on Github (opens new window)