mirror of https://gitee.com/bigwinds/arangodb
|
||
---|---|---|
.. | ||
BulkImport.md | ||
CollectionManipulation.md | ||
DocumentManipulation.md | ||
Indexes.md | ||
README.md |
README.md
Collection API
These functions implement the HTTP API for collections.
The ArangoCollection API is used for all collections, regardless of their specific type (document/edge collection).
Getting information about the collection
See the HTTP API documentation for details.
ArangoCollection.exists
ArangoCollection.exists() : boolean
Checks whether the collection exists
Examples
ArangoDB arango = new ArangoDB.Builder().build();
ArangoDatabase db = arango.db("myDB");
ArangoCollection collection = db.collection("potatos");
boolean exists = collection.exists();
ArangoCollection.getInfo
ArangoCollection.getInfo() : CollectionEntity
Returns information about the collection.
Examples
ArangoDB arango = new ArangoDB.Builder().build();
ArangoDatabase db = arango.db("myDB");
ArangoCollection collection = db.collection("potatos");
CollectionEntity info = collection.getInfo();
ArangoCollection.getProperties
ArangoCollection.getProperties() : CollectionPropertiesEntity
Reads the properties of the specified collection.
Examples
ArangoDB arango = new ArangoDB.Builder().build();
ArangoDatabase db = arango.db("myDB");
ArangoCollection collection = db.collection("potatos");
CollectionPropertiesEntity properties = collection.getProperties();
ArangoCollection.getRevision
ArangoCollection.getRevision() : CollectionRevisionEntity
Retrieve the collections revision.
Examples
ArangoDB arango = new ArangoDB.Builder().build();
ArangoDatabase db = arango.db("myDB");
ArangoCollection collection = db.collection("potatos");
CollectionRevisionEntity revision = collection.getRevision();
ArangoCollection.getIndexes
ArangoCollection.getIndexes() : Collection<IndexEntity>
Fetches a list of all indexes on this collection.
Examples
ArangoDB arango = new ArangoDB.Builder().build();
ArangoDatabase db = arango.db("myDB");
ArangoCollection collection = db.collection("potatos");
Collection<IndexEntity> indexes = collection.getIndexes();