Core
API v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

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 #

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

Other protocols #

{
  "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).

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