Core
API v2.x
2

zunionstore #

Computes the union of the provided sorted sets, and stores the result in a new sorted set.

[Redis documentation]


Query Syntax #

HTTP #

Copied to clipboard!
URL: http://kuzzle:7512/ms/_zunionstore/<_id>
Method: POST
Body:
Copied to clipboard!
{
  "keys": ["key1", "key2", "..."],
  // optional
  "weights": ["weight1", "weight2", "..."],
  "aggregate": "[sum|min|max]"
}

Other protocols #

Copied to clipboard!
{
  "controller": "ms",
  "action": "zunionstore",
  "_id": "<key>",
  "body": {
    "keys": ["key1", "key2", "..."],
    // optional
    "weights": ["weight1", "weight2", "..."],
    "aggregate": "[sum|min|max]"
  }
}

Argument #

  • _id: sorted set to create/overwrite with the computed intersection

Body properties #

Optional: #

  • aggregate (default: sum): specifies how members' scores are aggregated during the union
  • weights: specifies a multiplication factor for each input sorted set

Response #

Returns the number of members added to the destination sorted set.

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