|
| 1 | +# Collection API |
| 2 | + |
| 3 | +These functions implement the |
| 4 | +[HTTP API for collections](https://docs.arangodb.com/latest/HTTP/Collection/index.html). |
| 5 | + |
| 6 | +The _ArangoCollection_ API is used for all collections, regardless of |
| 7 | +their specific type (document/edge collection). |
| 8 | + |
| 9 | +## Getting information about the collection |
| 10 | + |
| 11 | +See |
| 12 | +[the HTTP API documentation](https://docs.arangodb.com/latest/HTTP/Collection/Getting.html) |
| 13 | +for details. |
| 14 | + |
| 15 | +## ArangoCollection.exists |
| 16 | + |
| 17 | +``` |
| 18 | +ArangoCollection.exists() : boolean |
| 19 | +``` |
| 20 | + |
| 21 | +Checks whether the collection exists |
| 22 | + |
| 23 | +**Examples** |
| 24 | + |
| 25 | +```Java |
| 26 | +ArangoDB arango = new ArangoDB.Builder().build(); |
| 27 | +ArangoDatabase db = arango.db("myDB"); |
| 28 | +ArangoCollection collection = db.collection("potatos"); |
| 29 | + |
| 30 | +boolean exists = collection.exists(); |
| 31 | +``` |
| 32 | + |
| 33 | +## ArangoCollection.getInfo |
| 34 | + |
| 35 | +``` |
| 36 | +ArangoCollection.getInfo() : CollectionEntity |
| 37 | +``` |
| 38 | + |
| 39 | +Returns information about the collection. |
| 40 | + |
| 41 | +**Examples** |
| 42 | + |
| 43 | +```Java |
| 44 | +ArangoDB arango = new ArangoDB.Builder().build(); |
| 45 | +ArangoDatabase db = arango.db("myDB"); |
| 46 | +ArangoCollection collection = db.collection("potatos"); |
| 47 | + |
| 48 | +CollectionEntity info = collection.getInfo(); |
| 49 | +``` |
| 50 | + |
| 51 | +## ArangoCollection.getProperties |
| 52 | + |
| 53 | +``` |
| 54 | +ArangoCollection.getProperties() : CollectionPropertiesEntity |
| 55 | +``` |
| 56 | + |
| 57 | +Reads the properties of the specified collection. |
| 58 | + |
| 59 | +**Examples** |
| 60 | + |
| 61 | +```Java |
| 62 | +ArangoDB arango = new ArangoDB.Builder().build(); |
| 63 | +ArangoDatabase db = arango.db("myDB"); |
| 64 | +ArangoCollection collection = db.collection("potatos"); |
| 65 | + |
| 66 | +CollectionPropertiesEntity properties = collection.getProperties(); |
| 67 | +``` |
| 68 | + |
| 69 | +## ArangoCollection.getRevision |
| 70 | + |
| 71 | +``` |
| 72 | +ArangoCollection.getRevision() : CollectionRevisionEntity |
| 73 | +``` |
| 74 | + |
| 75 | +Retrieve the collections revision. |
| 76 | + |
| 77 | +**Examples** |
| 78 | + |
| 79 | +```Java |
| 80 | +ArangoDB arango = new ArangoDB.Builder().build(); |
| 81 | +ArangoDatabase db = arango.db("myDB"); |
| 82 | +ArangoCollection collection = db.collection("potatos"); |
| 83 | + |
| 84 | +CollectionRevisionEntity revision = collection.getRevision(); |
| 85 | +``` |
| 86 | + |
| 87 | +## ArangoCollection.getIndexes |
| 88 | + |
| 89 | +``` |
| 90 | +ArangoCollection.getIndexes() : Collection<IndexEntity> |
| 91 | +``` |
| 92 | + |
| 93 | +Fetches a list of all indexes on this collection. |
| 94 | + |
| 95 | +**Examples** |
| 96 | + |
| 97 | +```Java |
| 98 | +ArangoDB arango = new ArangoDB.Builder().build(); |
| 99 | +ArangoDatabase db = arango.db("myDB"); |
| 100 | +ArangoCollection collection = db.collection("potatos"); |
| 101 | + |
| 102 | +Collection<IndexEntity> indexes = collection.getIndexes(); |
| 103 | +``` |
0 commit comments