Core
API v2.x
2

sadd #

Adds members to a set of unique values stored at key.

If the destination set does not exist, it is created beforehand.

[Redis documentation]


Query Syntax #

HTTP #

URL: http://kuzzle:7512/ms/_sadd/<_id>
Method: POST
Body:
{
  "members": ["member1", "member2", "..."]
}

Other protocols #

{
  "controller": "ms",
  "action": "sadd",
  "_id": "<key>",
  "body": {
    "members": ["member1", "member2", "..."]
  }
}

Argument #

  • _id: set key identifier

Body properties #

  • members: an array of values to add to the set

Response #

Returns the number of elements successfully added to the set.

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