public interface ArangoCollectionAsync extends ArangoSerializationAccessor
Modifier and Type | Method and Description |
---|---|
CompletableFuture<CollectionPropertiesEntity> |
changeProperties(CollectionPropertiesOptions options)
Changes the properties of a collection
|
CompletableFuture<CollectionPropertiesEntity> |
count()
Counts the documents in a collection
|
CompletableFuture<CollectionPropertiesEntity> |
count(CollectionCountOptions options)
Counts the documents in a collection
|
CompletableFuture<CollectionEntity> |
create()
Creates the collection
|
CompletableFuture<CollectionEntity> |
create(CollectionCreateOptions options)
Creates the collection
|
ArangoDatabaseAsync |
db()
The the handler of the database the collection is within
|
CompletableFuture<DocumentDeleteEntity<Void>> |
deleteDocument(String key)
Removes a document
|
<T> CompletableFuture<DocumentDeleteEntity<T>> |
deleteDocument(String key,
Class<T> type,
DocumentDeleteOptions options)
Removes a document
|
CompletableFuture<MultiDocumentEntity<DocumentDeleteEntity<Void>>> |
deleteDocuments(Collection<?> values)
Removes multiple document
|
<T> CompletableFuture<MultiDocumentEntity<DocumentDeleteEntity<T>>> |
deleteDocuments(Collection<?> values,
Class<T> type,
DocumentDeleteOptions options)
Removes multiple document
|
CompletableFuture<String> |
deleteIndex(String id)
Deletes an index
|
CompletableFuture<Boolean> |
documentExists(String key)
Checks if the document exists by reading a single document head
|
CompletableFuture<Boolean> |
documentExists(String key,
DocumentExistsOptions options)
Checks if the document exists by reading a single document head
|
CompletableFuture<Void> |
drop()
Drops the collection
|
CompletableFuture<Void> |
drop(boolean isSystem)
Drops the collection
|
CompletableFuture<IndexEntity> |
ensureFulltextIndex(Iterable<String> fields,
FulltextIndexOptions options)
Creates a fulltext index for the collection, if it does not already exist.
|
CompletableFuture<IndexEntity> |
ensureGeoIndex(Iterable<String> fields,
GeoIndexOptions options)
Creates a geo-spatial index for the collection, if it does not already exist.
|
CompletableFuture<IndexEntity> |
ensureHashIndex(Iterable<String> fields,
HashIndexOptions options)
Creates a hash index for the collection, if it does not already exist.
|
CompletableFuture<IndexEntity> |
ensurePersistentIndex(Iterable<String> fields,
PersistentIndexOptions options)
Creates a persistent index for the collection, if it does not already exist.
|
CompletableFuture<IndexEntity> |
ensureSkiplistIndex(Iterable<String> fields,
SkiplistIndexOptions options)
Creates a skip-list index for the collection, if it does not already exist.
|
CompletableFuture<IndexEntity> |
ensureTtlIndex(Iterable<String> fields,
TtlIndexOptions options)
Creates a ttl index for the collection, if it does not already exist.
|
CompletableFuture<Boolean> |
exists()
Checks whether the collection exists
|
<T> CompletableFuture<T> |
getDocument(String key,
Class<T> type)
Reads a single document
|
<T> CompletableFuture<T> |
getDocument(String key,
Class<T> type,
DocumentReadOptions options)
Reads a single document
|
<T> CompletableFuture<MultiDocumentEntity<T>> |
getDocuments(Collection<String> keys,
Class<T> type)
Reads multiple documents
|
<T> CompletableFuture<MultiDocumentEntity<T>> |
getDocuments(Collection<String> keys,
Class<T> type,
DocumentReadOptions options)
Reads multiple documents
|
CompletableFuture<IndexEntity> |
getIndex(String id)
Returns an index
|
CompletableFuture<Collection<IndexEntity>> |
getIndexes()
Returns all indexes of the collection
|
CompletableFuture<CollectionEntity> |
getInfo()
Returns information about the collection
|
CompletableFuture<Permissions> |
getPermissions(String user)
Get the collection access level
|
CompletableFuture<CollectionPropertiesEntity> |
getProperties()
Reads the properties of the specified collection
|
CompletableFuture<ShardEntity> |
getResponsibleShard(Object value)
Returns the responsible shard for the document.
|
CompletableFuture<CollectionRevisionEntity> |
getRevision()
Retrieve the collections revision
|
CompletableFuture<Void> |
grantAccess(String user,
Permissions permissions)
Grants or revoke access to the collection for user user.
|
CompletableFuture<DocumentImportEntity> |
importDocuments(Collection<?> values)
Imports documents
|
CompletableFuture<DocumentImportEntity> |
importDocuments(Collection<?> values,
DocumentImportOptions options)
Imports documents
|
CompletableFuture<DocumentImportEntity> |
importDocuments(String values)
Imports documents
|
CompletableFuture<DocumentImportEntity> |
importDocuments(String values,
DocumentImportOptions options)
Imports documents
|
<T> CompletableFuture<DocumentCreateEntity<T>> |
insertDocument(T value)
Creates a new document from the given document, unless there is already a document with the _key given.
|
<T> CompletableFuture<DocumentCreateEntity<T>> |
insertDocument(T value,
DocumentCreateOptions options)
Creates a new document from the given document, unless there is already a document with the _key given.
|
<T> CompletableFuture<MultiDocumentEntity<DocumentCreateEntity<T>>> |
insertDocuments(Collection<T> values)
Creates new documents from the given documents, unless there is already a document with the _key given.
|
<T> CompletableFuture<MultiDocumentEntity<DocumentCreateEntity<T>>> |
insertDocuments(Collection<T> values,
DocumentCreateOptions options)
Creates new documents from the given documents, unless there is already a document with the _key given.
|
CompletableFuture<CollectionEntity> |
load()
Loads a collection into memory.
|
String |
name()
The name of the collection
|
CompletableFuture<CollectionEntity> |
rename(String newName)
Renames a collection
|
<T> CompletableFuture<DocumentUpdateEntity<T>> |
replaceDocument(String key,
T value)
Replaces the document with key with the one in the body, provided there is such a document and no precondition is
violated
|
<T> CompletableFuture<DocumentUpdateEntity<T>> |
replaceDocument(String key,
T value,
DocumentReplaceOptions options)
Replaces the document with key with the one in the body, provided there is such a document and no precondition is
violated
|
<T> CompletableFuture<MultiDocumentEntity<DocumentUpdateEntity<T>>> |
replaceDocuments(Collection<T> values)
Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are
specified by the _key attributes in the documents in values.
|
<T> CompletableFuture<MultiDocumentEntity<DocumentUpdateEntity<T>>> |
replaceDocuments(Collection<T> values,
DocumentReplaceOptions options)
Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are
specified by the _key attributes in the documents in values.
|
CompletableFuture<Void> |
resetAccess(String user)
Clear the collection access level, revert back to the default access level.
|
CompletableFuture<Void> |
revokeAccess(String user)
Revokes access to the collection for user user.
|
CompletableFuture<CollectionEntity> |
truncate()
Removes all documents from the collection, but leaves the indexes intact
|
CompletableFuture<CollectionEntity> |
truncate(CollectionTruncateOptions options)
Removes all documents from the collection, but leaves the indexes intact
|
CompletableFuture<CollectionEntity> |
unload()
Removes a collection from memory.
|
<T> CompletableFuture<DocumentUpdateEntity<T>> |
updateDocument(String key,
T value)
Partially updates the document identified by document-key.
|
<T> CompletableFuture<DocumentUpdateEntity<T>> |
updateDocument(String key,
T value,
DocumentUpdateOptions options)
Partially updates the document identified by document-key.
|
<T> CompletableFuture<MultiDocumentEntity<DocumentUpdateEntity<T>>> |
updateDocuments(Collection<T> values)
Partially updates documents, the documents to update are specified by the _key attributes in the objects on
values.
|
<T> CompletableFuture<MultiDocumentEntity<DocumentUpdateEntity<T>>> |
updateDocuments(Collection<T> values,
DocumentUpdateOptions options)
Partially updates documents, the documents to update are specified by the _key attributes in the objects on
values.
|
util, util
ArangoDatabaseAsync db()
String name()
<T> CompletableFuture<DocumentCreateEntity<T>> insertDocument(T value)
value
- A representation of a single document (POJO, VPackSlice or String for Json)<T> CompletableFuture<DocumentCreateEntity<T>> insertDocument(T value, DocumentCreateOptions options)
value
- A representation of a single document (POJO, VPackSlice or String for Json)options
- Additional options, can be null<T> CompletableFuture<MultiDocumentEntity<DocumentCreateEntity<T>>> insertDocuments(Collection<T> values)
values
- A List of documents (POJO, VPackSlice or String for Json)<T> CompletableFuture<MultiDocumentEntity<DocumentCreateEntity<T>>> insertDocuments(Collection<T> values, DocumentCreateOptions options)
values
- A List of documents (POJO, VPackSlice or String for Json)options
- Additional options, can be nullCompletableFuture<DocumentImportEntity> importDocuments(Collection<?> values)
values
- a list of Objects that will be stored as documentsCompletableFuture<DocumentImportEntity> importDocuments(Collection<?> values, DocumentImportOptions options)
values
- a list of Objects that will be stored as documentsoptions
- Additional options, can be nullCompletableFuture<DocumentImportEntity> importDocuments(String values)
values
- JSON-encoded array of objects that will be stored as documentsCompletableFuture<DocumentImportEntity> importDocuments(String values, DocumentImportOptions options)
values
- JSON-encoded array of objects that will be stored as documentsoptions
- Additional options, can be null<T> CompletableFuture<T> getDocument(String key, Class<T> type) throws ArangoDBException
key
- The key of the documenttype
- The type of the document (POJO class, VPackSlice or String for Json)ArangoDBException
<T> CompletableFuture<T> getDocument(String key, Class<T> type, DocumentReadOptions options) throws ArangoDBException
key
- The key of the documenttype
- The type of the document (POJO class, VPackSlice or String for Json)options
- Additional options, can be nullArangoDBException
<T> CompletableFuture<MultiDocumentEntity<T>> getDocuments(Collection<String> keys, Class<T> type)
keys
- The keys of the documentstype
- The type of the documents (POJO class, VPackSlice or String for Json)<T> CompletableFuture<MultiDocumentEntity<T>> getDocuments(Collection<String> keys, Class<T> type, DocumentReadOptions options)
keys
- The keys of the documentstype
- The type of the documents (POJO class, VPackSlice or String for Json)options
- Additional options, can be null<T> CompletableFuture<DocumentUpdateEntity<T>> replaceDocument(String key, T value)
key
- The key of the documentvalue
- A representation of a single document (POJO, VPackSlice or String for Json)<T> CompletableFuture<DocumentUpdateEntity<T>> replaceDocument(String key, T value, DocumentReplaceOptions options)
key
- The key of the documentvalue
- A representation of a single document (POJO, VPackSlice or String for Json)options
- Additional options, can be null<T> CompletableFuture<MultiDocumentEntity<DocumentUpdateEntity<T>>> replaceDocuments(Collection<T> values)
values
- A List of documents (POJO, VPackSlice or String for Json)<T> CompletableFuture<MultiDocumentEntity<DocumentUpdateEntity<T>>> replaceDocuments(Collection<T> values, DocumentReplaceOptions options)
values
- A List of documents (POJO, VPackSlice or String for Json)options
- Additional options, can be null<T> CompletableFuture<DocumentUpdateEntity<T>> updateDocument(String key, T value)
key
- The key of the documentvalue
- A representation of a single document (POJO, VPackSlice or String for Json)<T> CompletableFuture<DocumentUpdateEntity<T>> updateDocument(String key, T value, DocumentUpdateOptions options)
key
- The key of the documentvalue
- A representation of a single document (POJO, VPackSlice or String for Json)options
- Additional options, can be null<T> CompletableFuture<MultiDocumentEntity<DocumentUpdateEntity<T>>> updateDocuments(Collection<T> values)
values
- A list of documents (POJO, VPackSlice or String for Json)<T> CompletableFuture<MultiDocumentEntity<DocumentUpdateEntity<T>>> updateDocuments(Collection<T> values, DocumentUpdateOptions options)
values
- A list of documents (POJO, VPackSlice or String for Json)options
- Additional options, can be nullCompletableFuture<DocumentDeleteEntity<Void>> deleteDocument(String key)
key
- The key of the document<T> CompletableFuture<DocumentDeleteEntity<T>> deleteDocument(String key, Class<T> type, DocumentDeleteOptions options)
key
- The key of the documenttype
- The type of the document (POJO class, VPackSlice or String for Json). Only necessary if
options.returnOld is set to true, otherwise can be null.options
- Additional options, can be nullCompletableFuture<MultiDocumentEntity<DocumentDeleteEntity<Void>>> deleteDocuments(Collection<?> values)
values
- The keys of the documents or the documents themselves<T> CompletableFuture<MultiDocumentEntity<DocumentDeleteEntity<T>>> deleteDocuments(Collection<?> values, Class<T> type, DocumentDeleteOptions options)
values
- The keys of the documents or the documents themselvestype
- The type of the documents (POJO class, VPackSlice or String for Json). Only necessary if
options.returnOld is set to true, otherwise can be null.options
- Additional options, can be nullCompletableFuture<Boolean> documentExists(String key)
key
- The key of the documentCompletableFuture<Boolean> documentExists(String key, DocumentExistsOptions options)
key
- The key of the documentoptions
- Additional options, can be nullCompletableFuture<IndexEntity> getIndex(String id)
id
- The index-handleCompletableFuture<String> deleteIndex(String id)
id
- The index-handleCompletableFuture<IndexEntity> ensureHashIndex(Iterable<String> fields, HashIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be nullCompletableFuture<IndexEntity> ensureSkiplistIndex(Iterable<String> fields, SkiplistIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be nullCompletableFuture<IndexEntity> ensurePersistentIndex(Iterable<String> fields, PersistentIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be nullCompletableFuture<IndexEntity> ensureGeoIndex(Iterable<String> fields, GeoIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be nullCompletableFuture<IndexEntity> ensureFulltextIndex(Iterable<String> fields, FulltextIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be nullCompletableFuture<IndexEntity> ensureTtlIndex(Iterable<String> fields, TtlIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be nullCompletableFuture<Collection<IndexEntity>> getIndexes()
CompletableFuture<Boolean> exists()
CompletableFuture<CollectionEntity> truncate()
CompletableFuture<CollectionEntity> truncate(CollectionTruncateOptions options)
CompletableFuture<CollectionPropertiesEntity> count()
CompletableFuture<CollectionPropertiesEntity> count(CollectionCountOptions options)
CompletableFuture<CollectionEntity> create()
CompletableFuture<CollectionEntity> create(CollectionCreateOptions options)
options
- Additional options, can be nullCompletableFuture<Void> drop()
CompletableFuture<Void> drop(boolean isSystem)
isSystem
- Whether or not the collection to drop is a system collection. This parameter must be set to true in
order to drop a system collection.CompletableFuture<CollectionEntity> load()
CompletableFuture<CollectionEntity> unload()
CompletableFuture<CollectionEntity> getInfo()
CompletableFuture<CollectionPropertiesEntity> getProperties()
CompletableFuture<CollectionPropertiesEntity> changeProperties(CollectionPropertiesOptions options)
options
- Additional options, can be nullCompletableFuture<CollectionEntity> rename(String newName)
newName
- The new nameCompletableFuture<ShardEntity> getResponsibleShard(Object value)
value
- A projection of the document containing at least the shard key (_key or a custom attribute) for
which the responsible shard should be determinedCompletableFuture<CollectionRevisionEntity> getRevision()
CompletableFuture<Void> grantAccess(String user, Permissions permissions)
user
- The name of the userpermissions
- The permissions the user grantCompletableFuture<Void> revokeAccess(String user)
user
- The name of the userCompletableFuture<Void> resetAccess(String user)
user
- The name of the userCompletableFuture<Permissions> getPermissions(String user)
user
- The name of the userCopyright © 2016–2020 ArangoDB GmbH. All rights reserved.