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.

ltrim #

Trims an existing list so that it will contain only the specified range of elements specified.

[Redis documentation]


Query Syntax #

HTTP #

URL: http://kuzzle:7512/ms/_ltrim/<_id>
Method: POST
Body:
{
  "start": 0,
  "stop": -1
}

Other protocols #

{
  "controller": "ms",
  "action": "ltrim",
  "_id": "<key>",
  "body": {
    "start": 0,
    "stop": -1
  }
}

Argument #

  • _id: list key identifier

Body properties #

  • start: start index
  • stop: end index

The arguments start and stop can be negative. In that case, the index is calculated from the end of the list, going backward. For instance, -3 is the third element from the end of the list.


Response #

Returns an acknowledgement.

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