Core
API v2.x
2

hset #

Sets a field and its value in a hash.

If the key does not exist, a new key holding a hash is created.

If the field already exists, its value is overwritten.

[Redis documentation]


Query Syntax #

HTTP #

Copied to clipboard!
URL: http://kuzzle:7512/ms/_hset/<_id>
Method: POST
Body:
Copied to clipboard!
{
  "field": "<field name>",
  "value": "<field value>"
}

Other protocols #

Copied to clipboard!
{
  "controller": "ms",
  "action": "hset",
  "_id": "<key>",
  "body": {
    "field": "<field name>",
    "value": "<field value>"
  }
}

Arguments #

  • _id: hash key identifier

Body properties #

  • field: hash field name to set
  • value: hash field value

Response #

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

Copied to clipboard!
{
  "requestId": "<unique request identifier>",
  "status": 200,
  "error": null,
  "controller": "ms",
  "action": "hset",
  "collection": null,
  "index": null,
  "result": 1
}