{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [],
"parameters": [
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "body",
"description": "the body with name, options of a collection. "
}
],
"notes": "Creates an new collection with a given name. The request must contain an object with the following attributes.
- name: The name of the collection.
- waitForSync (optional, default: false): If true then the data is synchronised to disk before returning from a create or update of a document.
- journalSize (optional, default is a @ref CommandLineArangod \"configuration parameter\"): The maximal size of a journal or datafile. Note that this also limits the maximal size of a single object. Must be at least 1MB.
- isSystem (optional, default is false): If true, create a system collection. In this case collection-name should start with an underscore. End users should normally create non-system collections only. API implementors may be required to create system collections in very special occasions, but normally a regular collection will do.
- isVolatile (optional, default is false): If true then the collection data is kept in-memory only and not made persistent. Unloading the collection will cause the collection data to be discarded. Stopping or re-starting the server will also cause full loss of data in the collection. Setting this option will make the resulting collection be slightly faster than regular collections because ArangoDB does not enforce any synchronisation to disk and does not calculate any CRC checksums for datafiles (as there are no datafiles).
This option should threrefore be used for cache-type collections only, and not for data that cannot be re-created otherwise.
- keyOptions (optional) additional options for key generation. If specified, then keyOptions should be a JSON array containing the following attributes (note: some of them are optional): - type: specifies the type of the key generator. The currently available generators are traditional and autoincrement. - allowUserKeys: if set to true, then it is allowed to supply own key values in the _key attribute of a document. If set to false, then the key generator will solely be responsible for generating keys and supplying own key values in the _key attribute of documents is considered an error. - increment: increment value for autoincrement key generator. Not used for other key generator types. - offset: initial offset value for autoincrement key generator. Not used for other key generator types.
- type (optional, default is 2): the type of the collection to create. The following values for type are valid: - 2: document collection - 3: edges collection
",
"summary": "creates a collection",
"httpMethod": "POST",
"examples": "
unix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{ \"name\": \"testCollectionBasics\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionBasics\n\n{ \n \"id\" : \"78916828\", \n \"name\" : \"testCollectionBasics\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\nunix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{ \"name\": \"testCollectionEdges\", \"type\" : 3 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionEdges\n\n{ \n \"id\" : \"79703260\", \n \"name\" : \"testCollectionEdges\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 3, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X POST --data @- --dump - http://localhost:8529/_api/collection\n{ \"name\": \"testCollectionUsers\", \"keyOptions\" : { \"type\" : \"autoincrement\", \"increment\" : 5, \"allowUserKeys\" : true }}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/testCollectionUsers\n\n{ \n \"id\" : \"47525084\", \n \"name\" : \"testCollectionUsers\", \n \"waitForSync\" : false, \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl --dump - http://localhost:8529/_api/collection\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"collections\" : [ \n { \n \"id\" : \"2763996\", \n \"name\" : \"_modules\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"7810268\", \n \"name\" : \"_aqlfunctions\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"77020\", \n \"name\" : \"_users\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"21245148\", \n \"name\" : \"demo\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"3681500\", \n \"name\" : \"_routing\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"10038492\", \n \"name\" : \"_trx\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"1649884\", \n \"name\" : \"_graphs\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"6630620\", \n \"name\" : \"_aal\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"47525084\", \n \"name\" : \"testCollectionUsers\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"8793308\", \n \"name\" : \"_fishbowl\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"23080156\", \n \"name\" : \"animals\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"5582044\", \n \"name\" : \"_structures\", \n \"status\" : 3, \n \"type\" : 2 \n } \n ], \n \"names\" : { \n \"_modules\" : { \n \"id\" : \"2763996\", \n \"name\" : \"_modules\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_aqlfunctions\" : { \n \"id\" : \"7810268\", \n \"name\" : \"_aqlfunctions\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_users\" : { \n \"id\" : \"77020\", \n \"name\" : \"_users\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"demo\" : { \n \"id\" : \"21245148\", \n \"name\" : \"demo\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_routing\" : { \n \"id\" : \"3681500\", \n \"name\" : \"_routing\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_trx\" : { \n \"id\" : \"10038492\", \n \"name\" : \"_trx\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_graphs\" : { \n \"id\" : \"1649884\", \n \"name\" : \"_graphs\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_aal\" : { \n \"id\" : \"6630620\", \n \"name\" : \"_aal\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"testCollectionUsers\" : { \n \"id\" : \"47525084\", \n \"name\" : \"testCollectionUsers\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_fishbowl\" : { \n \"id\" : \"8793308\", \n \"name\" : \"_fishbowl\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"animals\" : { \n \"id\" : \"23080156\", \n \"name\" : \"animals\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_structures\" : { \n \"id\" : \"5582044\", \n \"name\" : \"_structures\", \n \"status\" : 3, \n \"type\" : 2 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl --dump - http://localhost:8529/_api/collection/208547036/properties\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/properties\n\n{ \n \"id\" : \"208547036\", \n \"name\" : \"products\", \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl --dump - http://localhost:8529/_api/collection/products/properties\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/properties\n\n{ \n \"id\" : \"171584732\", \n \"name\" : \"products\", \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl --dump - http://localhost:8529/_api/collection/172567772/count\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/count\n\n{ \n \"id\" : \"172567772\", \n \"name\" : \"products\", \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"count\" : 100, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl --dump - http://localhost:8529/_api/collection/111422684/figures\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_api/collection/products/figures\n\n{ \n \"id\" : \"111422684\", \n \"name\" : \"products\", \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"count\" : 0, \n \"figures\" : { \n \"alive\" : { \n \"count\" : 0, \n \"size\" : 0 \n }, \n \"dead\" : { \n \"count\" : 0, \n \"size\" : 0, \n \"deletion\" : 0 \n }, \n \"datafiles\" : { \n \"count\" : 0, \n \"fileSize\" : 0 \n }, \n \"journals\" : { \n \"count\" : 0, \n \"fileSize\" : 0 \n }, \n \"shapes\" : { \n \"count\" : 6 \n }, \n \"attributes\" : { \n \"count\" : 0 \n } \n }, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --dump - http://localhost:8529/_api/collection/244985052/load\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"244985052\", \n \"name\" : \"products\", \n \"count\" : 0, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --dump - http://localhost:8529/_api/collection/39070940/unload\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"39070940\", \n \"name\" : \"products\", \n \"status\" : 2, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --dump - http://localhost:8529/_api/collection/159067356/truncate\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"159067356\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/201927900/properties\n{\"waitForSync\":true}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"201927900\", \n \"name\" : \"products\", \n \"isVolatile\" : false, \n \"isSystem\" : false, \n \"journalSize\" : 1048576, \n \"keyOptions\" : { \n \"type\" : \"traditional\", \n \"allowUserKeys\" : true \n }, \n \"waitForSync\" : true, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/199437532/rename\n{\"name\":\"newname\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"199437532\", \n \"name\" : \"newname\", \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X DELETE --dump - http://localhost:8529/_api/collection/217066716\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"217066716\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X DELETE --dump - http://localhost:8529/_api/collection/products1\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"132590812\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n