lpush

Prepends the specified values to a list.

If the key does not exist, it is created holding an empty list before performing the operation.

[Redis documentation]


Query Syntax

HTTP

Copied to clipboard!
URL: http://kuzzle:7512/ms/_lpush/<_id>
Method: POST
Body:
Copied to clipboard!
{
  "values": ["value1", "value2", "..."]
}

Other protocols

Copied to clipboard!
{
  "controller": "ms",
  "action": "lpush",
  "_id": "<key>",
  "body": {
    "values": ["value1", "value2", "..."]
  }
}

Argument

  • _id: list key identifier

Body properties

  • values: array of values to push to the list

Response

Returns the updated length of the list.

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