1
0
Fork 0
arangodb/js/apps/system/aardvark/api-docs/collection.json

435 lines
42 KiB
JSON

{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [],
"parameters": [
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "body",
"description": "the body with name and options for a collection. "
}
],
"notes": "Creates an new collection with a given name. The request must contain an object with the following attributes. <br><br>- <em>name</em>: The name of the collection.<br><br>- <em>waitForSync</em> (optional, default: false): If <em>true</em> then the data is synchronised to disk before returning from a create or update of a document. <br><br>- <em>doCompact</em> (optional, default is <em>true</em>): whether or not the collection will be compacted. <br><br>- <em>journalSize</em> (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. <br><br>- <em>isSystem</em> (optional, default is <em>false</em>): If <em>true</em>, create a system collection. In this case <em>collection-name</em> 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. <br><br>- <em>isVolatile</em> (optional, default is <em>false</em>): If <em>true</em> 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). <br><br> This option should threrefore be used for cache-type collections only, and not for data that cannot be re-created otherwise. <br><br>- <em>keyOptions</em> (optional) additional options for key generation. If specified, then <em>keyOptions</em> should be a JSON array containing the following attributes (note: some of them are optional): - <em>type</em>: specifies the type of the key generator. The currently available generators are <em>traditional</em> and <em>autoincrement</em>. - <em>allowUserKeys</em>: if set to <em>true</em>, then it is allowed to supply own key values in the <em>_key</em> attribute of a document. If set to <em>false</em>, then the key generator will solely be responsible for generating keys and supplying own key values in the <em>_key</em> attribute of documents is considered an error. - <em>increment</em>: increment value for <em>autoincrement</em> key generator. Not used for other key generator types. - <em>offset</em>: initial offset value for <em>autoincrement</em> key generator. Not used for other key generator types. <br><br>- <em>type</em> (optional, default is <em>2</em>): the type of the collection to create. The following values for <em>type</em> are valid: - <em>2</em>: document collection - <em>3</em>: edges collection <br><br>",
"summary": "creates a collection",
"httpMethod": "POST",
"examples": "<br><br><pre><code class=\"json\" >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: /_db/_system/_api/collection/testCollectionBasics\n\n{ \n \"id\" : \"19284391\", \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: /_db/_system/_api/collection/testCollectionEdges\n\n{ \n \"id\" : \"20005287\", \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</code></pre><br><br><br><pre><code class=\"json\" >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: /_db/_system/_api/collection/testCollectionUsers\n\n{ \n \"id\" : \"20726183\", \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</code></pre><br>",
"nickname": "createsACollection"
}
],
"path": "/_api/collection"
},
{
"operations": [
{
"errorResponses": [],
"parameters": [
{
"dataType": "Boolean",
"paramType": "query",
"name": "excludeSystem",
"description": "Whether or not system collections should be excluded from the result. "
}
],
"notes": "Returns an object with an attribute <em>collections</em> containing a list of all collection descriptions. The same information is also available in the <em>names</em> as hash map with the collection names as keys. <br><br>By providing the optional URL parameter <em>excludeSystem</em> with a value of <em>true</em>, all system collections will be excluded from the response. <br><br>",
"summary": "reads all collections",
"httpMethod": "GET",
"examples": "Return information about all collections: <br><br><pre><code class=\"json\" >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\" : \"147879\", \n \"name\" : \"_users\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"1720743\", \n \"name\" : \"_graphs\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"5325223\", \n \"name\" : \"_aal\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"3228071\", \n \"name\" : \"_routing\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"2572711\", \n \"name\" : \"_modules\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"7553447\", \n \"name\" : \"_replication\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"6898087\", \n \"name\" : \"_trx\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"6242727\", \n \"name\" : \"_aqlfunctions\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"14762407\", \n \"name\" : \"demo\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n { \n \"id\" : \"16204199\", \n \"name\" : \"animals\", \n \"status\" : 3, \n \"type\" : 2 \n } \n ], \n \"names\" : { \n \"_users\" : { \n \"id\" : \"147879\", \n \"name\" : \"_users\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_graphs\" : { \n \"id\" : \"1720743\", \n \"name\" : \"_graphs\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_aal\" : { \n \"id\" : \"5325223\", \n \"name\" : \"_aal\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_routing\" : { \n \"id\" : \"3228071\", \n \"name\" : \"_routing\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_modules\" : { \n \"id\" : \"2572711\", \n \"name\" : \"_modules\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_replication\" : { \n \"id\" : \"7553447\", \n \"name\" : \"_replication\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_trx\" : { \n \"id\" : \"6898087\", \n \"name\" : \"_trx\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"_aqlfunctions\" : { \n \"id\" : \"6242727\", \n \"name\" : \"_aqlfunctions\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"demo\" : { \n \"id\" : \"14762407\", \n \"name\" : \"demo\", \n \"status\" : 3, \n \"type\" : 2 \n }, \n \"animals\" : { \n \"id\" : \"16204199\", \n \"name\" : \"animals\", \n \"status\" : 3, \n \"type\" : 2 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "readsAllCollections"
}
],
"path": "/_api/collection"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection. "
}
],
"notes": "The result is an object describing the collection with the following attributes: <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>status</em>: The status of the collection as number. - 1: new born collection - 2: unloaded - 3: loaded - 4: in the process of being unloaded - 5: deleted <br><br>Every other status indicates a corrupted collection. <br><br>- <em>type</em>: The type of the collection as number. - 2: document collection (normal case) - 3: edges collection <br><br>",
"summary": "returns information about a collection",
"httpMethod": "GET",
"examples": "",
"nickname": "returnsInformationAboutACollection"
}
],
"path": "/_api/collection/{collection-name}"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection. "
}
],
"notes": "In addition to the above, the result will always contain the <em>waitForSync</em>, <em>doCompact</em>, <em>journalSize</em>, and <em>isVolatile</em> properties. This is achieved by forcing a load of the underlying collection. <br><br>- <em>waitForSync</em>: If <em>true</em> then creating or changing a document will wait until the data has been synchronised to disk. <br><br>- <em>doCompact</em>: Whether or not the collection will be compacted.<br><br>- <em>journalSize</em>: The maximal size setting for journals / datafiles.<br><br>- <em>isVolatile</em>: If <em>true</em> then the collection data will be kept in memory only and ArangoDB will not write or sync the data to disk. <br><br>",
"summary": "reads the properties of a collection",
"httpMethod": "GET",
"examples": "Using an identifier: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/21381543/properties\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_db/_system/_api/collection/products/properties\n\n{ \n \"id\" : \"21381543\", \n \"name\" : \"products\", \n \"doCompact\" : true, \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</code></pre><br>Using a name: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/products/properties\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_db/_system/_api/collection/products/properties\n\n{ \n \"id\" : \"22036903\", \n \"name\" : \"products\", \n \"doCompact\" : true, \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</code></pre><br>",
"nickname": "readsThePropertiesOfACollection"
}
],
"path": "/_api/collection/{collection-name}/properties"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection. "
}
],
"notes": "In addition to the above, the result also contains the number of documents. Note that this will always load the collection into memory. <br><br>- <em>count</em>: The number of documents inside the collection.<br><br>",
"summary": "returns the number of documents in a collection",
"httpMethod": "GET",
"examples": "Using an identifier and requesting the number of documents: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/22692263/count\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_db/_system/_api/collection/products/count\n\n{ \n \"id\" : \"22692263\", \n \"name\" : \"products\", \n \"doCompact\" : true, \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</code></pre><br>",
"nickname": "returnsTheNumberOfDocumentsInACollection"
}
],
"path": "/_api/collection/{collection-name}/count"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection. "
}
],
"notes": "In addition to the above, the result also contains the number of documents and additional statistical information about the collection. Note that this will always load the collection into memory. <br><br>- <em>count</em>: The number of documents currently present in the collection.<br><br>- <em>figures.alive.count</em>: The number of currently active documents.<br><br>- <em>figures.alive.size</em>: The total size in bytes used by all active documents. <br><br>- <em>figures.dead.count</em>: The number of dead documents. This includes document versions that have been deleted or replaced by a newer version. <br><br>- <em>figures.dead.size</em>: The total size in bytes used by all dead documents.<br><br>- <em>figures.dead.deletion</em>: The total number of deletion markers in the collection. <br><br>- <em>figures.datafiles.count</em>: The number of current datafiles.- <em>figures.datafiles.fileSize</em>: The total filesize of all datafiles.<br><br>- <em>figures.journals.count</em>: The number of journal files.- <em>figures.journals.fileSize</em>: The total filesize of all journal files.<br><br>- <em>figures.compactors.count</em>: The number of compactor files.- <em>figures.compactors.fileSize</em>: The total filesize of all compactor files.<br><br>- <em>figures.shapefiles.count</em>: The number of shape files.- <em>figures.shapefiles.fileSize</em>: The total filesize of all shape files.<br><br>- <em>figures.shapes.count</em>: The total number of shapes in the collection (this includes shapes that are not in use anymore) <br><br>- <em>figures.attributes.count</em>: The total number of attributes in the collection (this includes attributes that are not in use anymore) <br><br>- <em>journalSize</em>: The maximal size of the journal in bytes.<br><br>Note: the filesizes of collection and index parameter JSON files are not reported. These files should normally have a size of a few bytes each. Please also note that the <em>fileSize</em> values are reported in bytes and reflect the logical file sizes. Some filesystems may use optimisations (e.g. sparse files) so that the actual physical file size is somewhat different. Directories and sub-directories may also require space in the file system, but this space is not reported in the <em>fileSize</em> results. <br><br>That means that the figures reported do not reflect the actual disk usage of the collection with 100% accuracy. The actual disk usage of a collection is normally slightly higher than the sum of the reported <em>fileSize</em> values. Still the sum of the <em>fileSize</em> values can still be used as a lower bound approximation of the disk usage. <br><br>",
"summary": "returns the stats for a collection",
"httpMethod": "GET",
"examples": "Using an identifier and requesting the figures of the collection: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/43270567/figures\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\nlocation: /_db/_system/_api/collection/products/figures\n\n{ \n \"id\" : \"43270567\", \n \"name\" : \"products\", \n \"doCompact\" : true, \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 \"compactors\" : { \n \"count\" : 0, \n \"fileSize\" : 0 \n }, \n \"shapefiles\" : { \n \"count\" : 1, \n \"fileSize\" : 2097152 \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</code></pre><br>",
"nickname": "returnsTheStatsForACollection"
}
],
"path": "/_api/collection/{collection-name}/figures"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection. "
}
],
"notes": "In addition to the above, the result will also contain the collection's revision id. The revision id is a server-generated string that clients can use to check whether data in a collection has changed since the last revision check. <br><br>- <em>revision</em>: The collection revision id as a string.<br><br>",
"summary": "return a collection revision id",
"httpMethod": "GET",
"examples": "Retrieving the revision of a collection <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/44056999/revision\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"44056999\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"revision\" : \"0\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "returnACollectionRevisionId"
}
],
"path": "/_api/collection/{collection-name}/revision"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection. "
},
{
"dataType": "Boolean",
"paramType": "query",
"name": "withRevisions",
"description": "Whether or not to include document revision ids in the checksum calculation. "
},
{
"dataType": "Boolean",
"paramType": "query",
"name": "withData",
"description": "Whether or not to include document body data in the checksum calculation. "
}
],
"notes": "Will calculate a checksum of the meta-data (keys and optionally revision ids) and optionally the document data in the collection. <br><br>The checksum can be used to compare if two collections on different ArangoDB instances contain the same contents. The current revision of the collection is returned too so one can make sure the checksums are calculated for the same state of data. <br><br>By default, the checksum will only be calculated on the <em>_key</em> system attribute of the documents contained in the collection. For edge collections, the system attributes <em>_from</em> and <em>_to</em> will also be included in the calculation. <br><br>By setting the optional URL parameter <em>withRevisions</em> to <em>true</em>, then revision ids (<em>_rev</em> system attributes) are included in the checksumming. <br><br>By providing the optional URL parameter <em>withData</em> with a value of <em>true</em>, the user-defined document attributes will be included in the calculation too. Note that including user-defined attributes will make the checksumming slower. <br><br>The response is a JSON object with the following attributes: <br><br>- <em>checksum</em>: The calculated checksum as a number.<br><br>- <em>revision</em>: The collection revision id as a string.<br><br>",
"summary": "returns a checksum for the collection",
"httpMethod": "GET",
"examples": "Retrieving the checksum of a collection: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/44777895/checksum\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"44777895\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"checksum\" : 111932461, \n \"revision\" : \"45629863\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Retrieving the checksum of a collection including the collection data, but not the revisions: <br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/collection/45892007/checksum?withRevisions=false&withData=true\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"45892007\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"checksum\" : 2724696652, \n \"revision\" : \"46743975\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "returnsAChecksumForTheCollection"
}
],
"path": "/_api/collection/{collection-name}/checksum"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection. "
}
],
"notes": "Loads a collection into memory. Returns the collection on success. <br><br>The request might optionally contain the following attribute: <br><br>- <em>count</em>: If set, this controls whether the return value should include the number of documents in the collection. Setting <em>count</em> to <em>false</em> may speed up loading a collection. The default value for <em>count</em> is <em>true</em>. <br><br>On success an object with the following attributes is returned: <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>count</em>: The number of documents inside the collection. This is only returned if the <em>count</em> input parameters is set to <em>true</em> or has not been specified. <br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are: - 2: document collection - 3: edges collection <br><br>",
"summary": "loads a collection",
"httpMethod": "PUT",
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/47006119/load\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"47006119\", \n \"name\" : \"products\", \n \"count\" : 0, \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "loadsACollection"
}
],
"path": "/_api/collection/{collection-name}/load"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": ""
}
],
"notes": "Removes a collection from memory. This call does not delete any documents. You can use the collection afterwards; in which case it will be loaded into memory, again. On success an object with the following attributes is returned: <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are: - 2: document collection - 3: edges collection <br><br>",
"summary": "unloads a collection",
"httpMethod": "PUT",
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/47727015/unload\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"47727015\", \n \"name\" : \"products\", \n \"status\" : 2, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "unloadsACollection"
}
],
"path": "/_api/collection/{collection-name}/unload"
},
{
"operations": [
{
"errorResponses": [],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection. "
}
],
"notes": "Removes all documents from the collection, but leaves the indexes intact. <br><br>",
"summary": "truncates a collection",
"httpMethod": "PUT",
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --dump - http://localhost:8529/_api/collection/48382375/truncate\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"48382375\", \n \"name\" : \"products\", \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "truncatesACollection"
}
],
"path": "/_api/collection/{collection-name}/truncate"
},
{
"operations": [
{
"errorResponses": [],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection. "
}
],
"notes": "Changes the properties of a collection. Expects an object with the attribute(s) <br><br>- <em>waitForSync</em>: If <em>true</em> then creating or changing a document will wait until the data has been synchronised to disk. <br><br>- <em>journalSize</em>: Size (in bytes) for new journal files that are created for the collection. <br><br>If returns an object with the attributes <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The name of the collection.<br><br>- <em>waitForSync</em>: The new value.<br><br>- <em>journalSize</em>: The new value.<br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are: - 2: document collection - 3: edges collection <br><br>Note: some other collection properties, such as <em>type</em> or <em>isVolatile</em> cannot be changed once the collection is created. <br><br>",
"summary": "changes the properties of a collection",
"httpMethod": "PUT",
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/49103271/properties\n{\"waitForSync\":true}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"49103271\", \n \"name\" : \"products\", \n \"doCompact\" : true, \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</code></pre><br>",
"nickname": "changesThePropertiesOfACollection"
}
],
"path": "/_api/collection/{collection-name}/properties"
},
{
"operations": [
{
"errorResponses": [],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection to rename. "
}
],
"notes": "Renames a collection. Expects an object with the attribute(s) <br><br>- <em>name</em>: The new name.<br><br>If returns an object with the attributes <br><br>- <em>id</em>: The identifier of the collection.<br><br>- <em>name</em>: The new name of the collection.<br><br>- <em>status</em>: The status of the collection as number.<br><br>- <em>type</em>: The collection type. Valid types are: - 2: document collection - 3: edges collection <br><br>",
"summary": "renames a collection",
"httpMethod": "PUT",
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/49758631/rename\n{\"name\":\"newname\"}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"49758631\", \n \"name\" : \"newname\", \n \"status\" : 3, \n \"type\" : 2, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "renamesACollection"
}
],
"path": "/_api/collection/{collection-name}/rename"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the collection currently has no journal, <em>HTTP 500</em> is returned. ",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection. "
}
],
"notes": "Rotates the journal of a collection. The current journal of the collection will be closed and made a read-only datafile. The purpose of the rotate method is to make the data in the file available for compaction (compaction is only performed for read-only datafiles, and not for journals). <br><br>Saving new data in the collection subsequently will create a new journal file automatically if there is no current journal. <br><br>If returns an object with the attributes <br><br>- <em>result</em>: will be <em>true</em> if rotation succeeded<br><br>",
"summary": "rotates the journal of a collection",
"httpMethod": "PUT",
"examples": "Rotating a journal: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/50413991/rotate\n{}\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true, \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Rotating without a journal: <br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/collection/51462567/rotate\n{}\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1105, \n \"errorMessage\" : \"could not rotate journal: no journal\" \n}\n\n</code></pre><br>",
"nickname": "rotatesTheJournalOfACollection"
}
],
"path": "/_api/collection/{collection-name}/rotate"
},
{
"operations": [
{
"errorResponses": [
{
"reason": "If the <em>collection-name</em> is missing, then a <em>HTTP 400</em> is returned. ",
"code": "400"
},
{
"reason": "If the <em>collection-name</em> is unknown, then a <em>HTTP 404</em> is returned. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "path",
"required": "true",
"name": "collection-name",
"description": "The name of the collection to delete. "
}
],
"notes": "Deletes a collection identified by <em>collection-name</em>. <br><br>If the collection was successfully deleted then, an object is returned with the following attributes: <br><br>- <em>error</em>: <em>false</em><br><br>- <em>id</em>: The identifier of the deleted collection.<br><br>",
"summary": "deletes a collection",
"httpMethod": "DELETE",
"examples": "Using an identifier: <br><br><pre><code class=\"json\" >unix> curl -X DELETE --dump - http://localhost:8529/_api/collection/52117927\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"52117927\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>Using a name: <br><br><pre><code class=\"json\" >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\" : \"52773287\", \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
"nickname": "deletesACollection"
}
],
"path": "/_api/collection/{collection-name}"
}
]
}