ArangoDB Manual Pages

Accessing Cap Constraints via Http
POST /_api/index
(creates a cap constraint)
POST /_api/index?collection=collection-name
Creates a cap constraint (Introduction to Cap Constraints) for the collection collection-name, if it does not already exist. Expects an object containing the index details.
  • type: must be equal to "cap".
  • size: The maximal number of documents for the collection.
If the index does not already exist and could be created, then a HTTP 201 is returned. If the index already exists, then a HTTP 200 is returned.If the collection-name is unknown, then a HTTP 404 is returned.
Creating a cap collection
> curl --data @- -X POST --dump - http://localhost:8529/_api/index?collection=1786279
{ "type" : "cap", "size" : 10 }

HTTP/1.1 201 Created
content-type: application/json

  "size": 10,
  "code": 201,
  "id": "1786279/2769319",
  "type": "cap",
  "isNewlyCreated": true,
  "error": false