Package com.arangodb
Interface ArangoCollection
-
- All Superinterfaces:
ArangoSerdeAccessor
@ThreadSafe public interface ArangoCollection extends ArangoSerdeAccessor
Interface for operations on ArangoDB collection level.- Author:
- Mark Vollmary, Heiko Kernbach, Michele Rastelli
- See Also:
- Collection API Documentation, Documents API Documentation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description CollectionPropertiesEntity
changeProperties(CollectionPropertiesOptions options)
Changes the properties of the collectionCollectionPropertiesEntity
count()
Counts the documents in a collectionCollectionPropertiesEntity
count(CollectionCountOptions options)
Counts the documents in a collectionCollectionEntity
create()
Creates a collection for this collection's name, then returns collection information from the server.CollectionEntity
create(CollectionCreateOptions options)
Creates a collection with the givenoptions
for this collection's name, then returns collection information from the server.ArangoDatabase
db()
The the handler of the database the collection is withinDocumentDeleteEntity<Void>
deleteDocument(String key)
Deletes the document with the givenkey
from the collection.DocumentDeleteEntity<Void>
deleteDocument(String key, DocumentDeleteOptions options)
Deletes the document with the givenkey
from the collection.<T> DocumentDeleteEntity<T>
deleteDocument(String key, DocumentDeleteOptions options, Class<T> type)
Deletes the document with the givenkey
from the collection.MultiDocumentEntity<DocumentDeleteEntity<Void>>
deleteDocuments(RawData values)
Deletes multiple documents from the collection.MultiDocumentEntity<DocumentDeleteEntity<RawData>>
deleteDocuments(RawData values, DocumentDeleteOptions options)
Deletes multiple documents from the collection.MultiDocumentEntity<DocumentDeleteEntity<Void>>
deleteDocuments(Collection<?> values)
Deletes multiple documents from the collection.<T> MultiDocumentEntity<DocumentDeleteEntity<T>>
deleteDocuments(Collection<?> values, DocumentDeleteOptions options)
Deletes multiple documents from the collection.<T> MultiDocumentEntity<DocumentDeleteEntity<T>>
deleteDocuments(Collection<?> values, DocumentDeleteOptions options, Class<T> type)
Deletes multiple documents from the collection.String
deleteIndex(String id)
Deletes the index with the givenid
from the collection.Boolean
documentExists(String key)
Checks if the document exists by reading a single document headBoolean
documentExists(String key, DocumentExistsOptions options)
Checks if the document exists by reading a single document headvoid
drop()
Deletes the collection from the database.void
drop(boolean isSystem)
Deletes the collection from the database.IndexEntity
ensureFulltextIndex(Iterable<String> fields, FulltextIndexOptions options)
Deprecated.since ArangoDB 3.10, use ArangoSearch or Inverted indexes instead.IndexEntity
ensureGeoIndex(Iterable<String> fields, GeoIndexOptions options)
Creates a geo-spatial index for the collection, if it does not already exist.InvertedIndexEntity
ensureInvertedIndex(InvertedIndexOptions options)
Creates an inverted index for the collection, if it does not already exist.IndexEntity
ensurePersistentIndex(Iterable<String> fields, PersistentIndexOptions options)
Creates a persistent index for the collection, if it does not already exist.IndexEntity
ensureTtlIndex(Iterable<String> fields, TtlIndexOptions options)
Creates a ttl index for the collection, if it does not already exist.IndexEntity
ensureZKDIndex(Iterable<String> fields, ZKDIndexOptions options)
Creates a ZKD multi-dimensional index for the collection, if it does not already exist.boolean
exists()
Checks whether the collection exists<T> T
getDocument(String key, Class<T> type)
Retrieves the document with the givenkey
from the collection.<T> T
getDocument(String key, Class<T> type, DocumentReadOptions options)
Retrieves the document with the givenkey
from the collection.<T> MultiDocumentEntity<T>
getDocuments(Collection<String> keys, Class<T> type)
Retrieves multiple documents with the given_key
from the collection.<T> MultiDocumentEntity<T>
getDocuments(Collection<String> keys, Class<T> type, DocumentReadOptions options)
Retrieves multiple documents with the given_key
from the collection.IndexEntity
getIndex(String id)
Fetches information about the index with the givenid
and returns it.Collection<IndexEntity>
getIndexes()
Fetches a list of all indexes on this collection.CollectionEntity
getInfo()
Returns information about the collectionInvertedIndexEntity
getInvertedIndex(String id)
Fetches information about the inverted index with the givenid
and returns it.Collection<InvertedIndexEntity>
getInvertedIndexes()
Fetches a list of all inverted indexes on this collection.Permissions
getPermissions(String user)
Get the collection access levelCollectionPropertiesEntity
getProperties()
Reads the properties of the specified collectionShardEntity
getResponsibleShard(Object value)
Returns the responsible shard for the document.CollectionRevisionEntity
getRevision()
Retrieve the collections revisionvoid
grantAccess(String user, Permissions permissions)
Grants or revoke access to the collection for user user.DocumentImportEntity
importDocuments(RawData values)
Bulk imports the given values into the collection.DocumentImportEntity
importDocuments(RawData values, DocumentImportOptions options)
Bulk imports the given values into the collection.DocumentImportEntity
importDocuments(Collection<?> values)
Bulk imports the given values into the collection.DocumentImportEntity
importDocuments(Collection<?> values, DocumentImportOptions options)
Bulk imports the given values into the collection.DocumentCreateEntity<Void>
insertDocument(Object value)
Creates a new document from the given document, unless there is already a document with the _key given.<T> 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> DocumentCreateEntity<T>
insertDocument(T value, DocumentCreateOptions options, Class<T> type)
Creates a new document from the given document, unless there is already a document with the _key given.MultiDocumentEntity<DocumentCreateEntity<Void>>
insertDocuments(RawData values)
Creates new documents from the given documents, unless there is already a document with the _key given.MultiDocumentEntity<DocumentCreateEntity<RawData>>
insertDocuments(RawData values, DocumentCreateOptions options)
Creates new documents from the given documents, unless there is already a document with the _key given.MultiDocumentEntity<DocumentCreateEntity<Void>>
insertDocuments(Collection<?> values)
Creates new documents from the given documents, unless there is already a document with the _key given.<T> 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.<T> MultiDocumentEntity<DocumentCreateEntity<T>>
insertDocuments(Collection<T> values, DocumentCreateOptions options, Class<T> type)
Creates new documents from the given documents, unless there is already a document with the _key given.String
name()
The name of the collectionCollectionEntity
rename(String newName)
Renames the collectionDocumentUpdateEntity<Void>
replaceDocument(String key, Object value)
Replaces the document withkey
with the one in the body, provided there is such a document and no precondition is violated<T> DocumentUpdateEntity<T>
replaceDocument(String key, T value, DocumentReplaceOptions options)
Replaces the document withkey
with the one in the body, provided there is such a document and no precondition is violated<T> DocumentUpdateEntity<T>
replaceDocument(String key, T value, DocumentReplaceOptions options, Class<T> type)
Replaces the document withkey
with the one in the body, provided there is such a document and no precondition is violatedMultiDocumentEntity<DocumentUpdateEntity<Void>>
replaceDocuments(RawData 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.MultiDocumentEntity<DocumentUpdateEntity<RawData>>
replaceDocuments(RawData 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.MultiDocumentEntity<DocumentUpdateEntity<Void>>
replaceDocuments(Collection<?> 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> 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.<T> MultiDocumentEntity<DocumentUpdateEntity<T>>
replaceDocuments(Collection<T> values, DocumentReplaceOptions options, Class<T> type)
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.void
resetAccess(String user)
Clear the collection access level, revert back to the default access level.void
revokeAccess(String user)
Revokes access to the collection for user user.CollectionEntity
truncate()
Removes all documents from the collection, but leaves the indexes intactCollectionEntity
truncate(CollectionTruncateOptions options)
Removes all documents from the collection, but leaves the indexes intactDocumentUpdateEntity<Void>
updateDocument(String key, Object value)
Partially updates the document identified by document-key.<T> DocumentUpdateEntity<T>
updateDocument(String key, Object value, DocumentUpdateOptions options, Class<T> returnType)
Partially updates the document identified by document-key.<T> DocumentUpdateEntity<T>
updateDocument(String key, T value, DocumentUpdateOptions options)
Partially updates the document identified by document-key.MultiDocumentEntity<DocumentUpdateEntity<Void>>
updateDocuments(RawData values)
Partially updates documents, the documents to update are specified by the _key attributes in the objects on values.MultiDocumentEntity<DocumentUpdateEntity<RawData>>
updateDocuments(RawData values, DocumentUpdateOptions options)
Partially updates documents, the documents to update are specified by the _key attributes in the objects on values.MultiDocumentEntity<DocumentUpdateEntity<Void>>
updateDocuments(Collection<?> values)
Partially updates documents, the documents to update are specified by the _key attributes in the objects on values.<T> MultiDocumentEntity<DocumentUpdateEntity<T>>
updateDocuments(Collection<?> values, DocumentUpdateOptions options, Class<T> returnType)
Partially updates documents, the documents to update are specified by the _key attributes in the objects on values.<T> 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.-
Methods inherited from interface com.arangodb.ArangoSerdeAccessor
getSerde
-
-
-
-
Method Detail
-
db
ArangoDatabase db()
The the handler of the database the collection is within- Returns:
- database handler
-
name
String name()
The name of the collection- Returns:
- collection name
-
insertDocument
DocumentCreateEntity<Void> insertDocument(Object value)
Creates a new document from the given document, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
value
- A representation of a single document (POJO orRawData
- Returns:
- information about the document
- See Also:
- API Documentation
-
insertDocument
<T> 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. If no _key is given, a new unique _key is generated automatically.- Parameters:
value
- A representation of a single document (POJO orRawData
)options
- Additional options- Returns:
- information about the document
- See Also:
- API Documentation
-
insertDocument
<T> DocumentCreateEntity<T> insertDocument(T value, DocumentCreateOptions options, Class<T> type)
Creates a new document from the given document, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
value
- A representation of a single document (POJO orRawData
)options
- Additional optionstype
- Deserialization target type for the returned documents.- Returns:
- information about the document
- See Also:
- API Documentation
-
insertDocuments
MultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(RawData values)
Creates new documents from the given documents, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
values
- Raw data representing a collection of documents- Returns:
- information about the documents
- See Also:
- API Documentation
-
insertDocuments
MultiDocumentEntity<DocumentCreateEntity<RawData>> insertDocuments(RawData values, DocumentCreateOptions options)
Creates new documents from the given documents, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
values
- Raw data representing a collection of documentsoptions
- Additional options- Returns:
- information about the documents
- See Also:
- API Documentation
-
insertDocuments
MultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(Collection<?> values)
Creates new documents from the given documents, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
values
- A List of documents- Returns:
- information about the documents
- See Also:
- API Documentation
-
insertDocuments
<T> 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. If no _key is given, a new unique _key is generated automatically.- Parameters:
values
- A List of documents (POJO orRawData
)options
- Additional options- Returns:
- information about the documents
- See Also:
- API Documentation
-
insertDocuments
<T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(Collection<T> values, DocumentCreateOptions options, Class<T> type)
Creates new documents from the given documents, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
values
- A List of documents (POJO orRawData
)options
- Additional optionstype
- Deserialization target type for the returned documents.- Returns:
- information about the documents
- See Also:
- API Documentation
-
importDocuments
DocumentImportEntity importDocuments(Collection<?> values)
Bulk imports the given values into the collection.- Parameters:
values
- A List of documents (POJO orRawData
)- Returns:
- information about the import
-
importDocuments
DocumentImportEntity importDocuments(Collection<?> values, DocumentImportOptions options)
Bulk imports the given values into the collection.- Parameters:
values
- A List of documents (POJO orRawData
)options
- Additional options, can be null- Returns:
- information about the import
-
importDocuments
DocumentImportEntity importDocuments(RawData values)
Bulk imports the given values into the collection.- Parameters:
values
- Raw data representing a collection of documents- Returns:
- information about the import
-
importDocuments
DocumentImportEntity importDocuments(RawData values, DocumentImportOptions options)
Bulk imports the given values into the collection.- Parameters:
values
- Raw data representing a collection of documentsoptions
- Additional options, can be null- Returns:
- information about the import
-
getDocument
<T> T getDocument(String key, Class<T> type)
Retrieves the document with the givenkey
from the collection.- Parameters:
key
- The key of the documenttype
- The type of the document (POJO orRawData
)- Returns:
- the document identified by the key
- See Also:
- API Documentation
-
getDocument
<T> T getDocument(String key, Class<T> type, DocumentReadOptions options)
Retrieves the document with the givenkey
from the collection.- Parameters:
key
- The key of the documenttype
- The type of the document (POJO orRawData
)options
- Additional options, can be null- Returns:
- the document identified by the key
- See Also:
- API Documentation
-
getDocuments
<T> MultiDocumentEntity<T> getDocuments(Collection<String> keys, Class<T> type)
Retrieves multiple documents with the given_key
from the collection.- Parameters:
keys
- The keys of the documentstype
- The type of the documents (POJO orRawData
)- Returns:
- the documents and possible errors
-
getDocuments
<T> MultiDocumentEntity<T> getDocuments(Collection<String> keys, Class<T> type, DocumentReadOptions options)
Retrieves multiple documents with the given_key
from the collection.- Parameters:
keys
- The keys of the documentstype
- The type of the documents (POJO orRawData
)options
- Additional options, can be null- Returns:
- the documents and possible errors
-
replaceDocument
DocumentUpdateEntity<Void> replaceDocument(String key, Object value)
Replaces the document withkey
with the one in the body, provided there is such a document and no precondition is violated- Parameters:
key
- The key of the documentvalue
- A representation of a single document (POJO orRawData
)- Returns:
- information about the document
- See Also:
- API Documentation
-
replaceDocument
<T> DocumentUpdateEntity<T> replaceDocument(String key, T value, DocumentReplaceOptions options)
Replaces the document withkey
with the one in the body, provided there is such a document and no precondition is violated- Parameters:
key
- The key of the documentvalue
- A representation of a single document (POJO orRawData
)options
- Additional options- Returns:
- information about the document
- See Also:
- API Documentation
-
replaceDocument
<T> DocumentUpdateEntity<T> replaceDocument(String key, T value, DocumentReplaceOptions options, Class<T> type)
Replaces the document withkey
with the one in the body, provided there is such a document and no precondition is violated- Parameters:
key
- The key of the documentvalue
- A representation of a single document (POJO orRawData
)options
- Additional optionstype
- Deserialization target type for the returned documents.- Returns:
- information about the document
- See Also:
- API Documentation
-
replaceDocuments
MultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(RawData 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.- Parameters:
values
- Raw data representing a collection of documents- Returns:
- information about the documents
- See Also:
- API Documentation
-
replaceDocuments
MultiDocumentEntity<DocumentUpdateEntity<RawData>> replaceDocuments(RawData 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.- Parameters:
values
- Raw data representing a collection of documentsoptions
- Additional options- Returns:
- information about the documents
- See Also:
- API Documentation
-
replaceDocuments
MultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(Collection<?> 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.- Parameters:
values
- A List of documents (POJO orRawData
)- Returns:
- information about the documents
- See Also:
- API Documentation
-
replaceDocuments
<T> 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.- Parameters:
values
- A List of documents (POJO orRawData
)options
- Additional options- Returns:
- information about the documents
- See Also:
- API Documentation
-
replaceDocuments
<T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(Collection<T> values, DocumentReplaceOptions options, Class<T> type)
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.- Parameters:
values
- A List of documents (POJO orRawData
)options
- Additional optionstype
- Deserialization target type for the returned documents.- Returns:
- information about the documents
- See Also:
- API Documentation
-
updateDocument
DocumentUpdateEntity<Void> updateDocument(String key, Object value)
Partially updates the document identified by document-key. The value must contain a document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.- Parameters:
key
- The key of the documentvalue
- A representation of a single document (POJO orRawData
)- Returns:
- information about the document
- See Also:
- API Documentation
-
updateDocument
<T> DocumentUpdateEntity<T> updateDocument(String key, T value, DocumentUpdateOptions options)
Partially updates the document identified by document-key. The value must contain a document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.- Parameters:
key
- The key of the documentvalue
- A representation of a single document (POJO orRawData
)options
- Additional options- Returns:
- information about the document
- See Also:
- API Documentation
-
updateDocument
<T> DocumentUpdateEntity<T> updateDocument(String key, Object value, DocumentUpdateOptions options, Class<T> returnType)
Partially updates the document identified by document-key. The value must contain a document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.- Parameters:
key
- The key of the documentvalue
- A representation of a single document (POJO orRawData
)options
- Additional optionsreturnType
- Type of the returned newDocument and/or oldDocument- Returns:
- information about the document
- See Also:
- API Documentation
-
updateDocuments
MultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(RawData values)
Partially updates documents, the documents to update are specified by the _key attributes in the objects on values. Vales must contain a list of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there.- Parameters:
values
- Raw data representing a collection of documents- Returns:
- information about the documents
- See Also:
- API Documentation
-
updateDocuments
MultiDocumentEntity<DocumentUpdateEntity<RawData>> updateDocuments(RawData values, DocumentUpdateOptions options)
Partially updates documents, the documents to update are specified by the _key attributes in the objects on values. Vales must contain a list of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there.- Parameters:
values
- Raw data representing a collection of documentsoptions
- Additional options- Returns:
- information about the documents
- See Also:
- API Documentation
-
updateDocuments
MultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(Collection<?> values)
Partially updates documents, the documents to update are specified by the _key attributes in the objects on values. Vales must contain a list of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there.- Parameters:
values
- A list of documents (POJO orRawData
)- Returns:
- information about the documents
- See Also:
- API Documentation
-
updateDocuments
<T> 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. Vales must contain a list of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there.- Parameters:
values
- A list of documents (POJO orRawData
)options
- Additional options- Returns:
- information about the documents
- See Also:
- API Documentation
-
updateDocuments
<T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(Collection<?> values, DocumentUpdateOptions options, Class<T> returnType)
Partially updates documents, the documents to update are specified by the _key attributes in the objects on values. Vales must contain a list of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there.- Parameters:
values
- A list of documents (POJO orRawData
)options
- Additional optionsreturnType
- Type of the returned newDocument and/or oldDocument- Returns:
- information about the documents
- See Also:
- API Documentation
-
deleteDocument
DocumentDeleteEntity<Void> deleteDocument(String key)
Deletes the document with the givenkey
from the collection.- Parameters:
key
- The key of the document- Returns:
- information about the document
- See Also:
- API Documentation
-
deleteDocument
DocumentDeleteEntity<Void> deleteDocument(String key, DocumentDeleteOptions options)
Deletes the document with the givenkey
from the collection.- Parameters:
key
- The key of the documentoptions
- Additional options- Returns:
- information about the document
- See Also:
- API Documentation
-
deleteDocument
<T> DocumentDeleteEntity<T> deleteDocument(String key, DocumentDeleteOptions options, Class<T> type)
Deletes the document with the givenkey
from the collection.- Parameters:
key
- The key of the documenttype
- Deserialization target type for the returned documents.options
- Additional options- Returns:
- information about the document
- See Also:
- API Documentation
-
deleteDocuments
MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(RawData values)
Deletes multiple documents from the collection.- Parameters:
values
- Raw data representing the keys of the documents or the documents themselves- Returns:
- information about the documents
- See Also:
- API Documentation
-
deleteDocuments
MultiDocumentEntity<DocumentDeleteEntity<RawData>> deleteDocuments(RawData values, DocumentDeleteOptions options)
Deletes multiple documents from the collection.- Parameters:
values
- Raw data representing the keys of the documents or the documents themselvesoptions
- Additional options- Returns:
- information about the documents
- See Also:
- API Documentation
-
deleteDocuments
MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(Collection<?> values)
Deletes multiple documents from the collection.- Parameters:
values
- The keys of the documents or the documents themselves- Returns:
- information about the documents
- See Also:
- API Documentation
-
deleteDocuments
<T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(Collection<?> values, DocumentDeleteOptions options)
Deletes multiple documents from the collection.- Parameters:
values
- The keys of the documents or the documents themselvesoptions
- Additional options- Returns:
- information about the documents
- See Also:
- API Documentation
-
deleteDocuments
<T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(Collection<?> values, DocumentDeleteOptions options, Class<T> type)
Deletes multiple documents from the collection.- Parameters:
values
- The keys of the documents or the documents themselvestype
- Deserialization target type for the returned documents.options
- Additional options- Returns:
- information about the documents
- See Also:
- API Documentation
-
documentExists
Boolean documentExists(String key)
Checks if the document exists by reading a single document head- Parameters:
key
- The key of the document- Returns:
- true if the document was found, otherwise false
- See Also:
- API Documentation
-
documentExists
Boolean documentExists(String key, DocumentExistsOptions options)
Checks if the document exists by reading a single document head- Parameters:
key
- The key of the documentoptions
- Additional options, can be null- Returns:
- true if the document was found, otherwise false
- See Also:
- API Documentation
-
getIndex
IndexEntity getIndex(String id)
Fetches information about the index with the givenid
and returns it.
Note: inverted indexes are not returned by this method. UsegetInvertedIndex(String)
instead.- Parameters:
id
- The index-handle- Returns:
- information about the index
- See Also:
- API Documentation
-
getInvertedIndex
InvertedIndexEntity getInvertedIndex(String id)
Fetches information about the inverted index with the givenid
and returns it.- Parameters:
id
- The index-handle- Returns:
- information about the index
- Since:
- ArangoDB 3.10
- See Also:
- API Documentation
-
deleteIndex
String deleteIndex(String id)
Deletes the index with the givenid
from the collection.- Parameters:
id
- The index-handle- Returns:
- the id of the index
- See Also:
- API Documentation
-
ensurePersistentIndex
IndexEntity ensurePersistentIndex(Iterable<String> fields, PersistentIndexOptions options)
Creates a persistent index for the collection, if it does not already exist.- Parameters:
fields
- A list of attribute pathsoptions
- Additional options, can be null- Returns:
- information about the index
- See Also:
- API Documentation
-
ensureGeoIndex
IndexEntity ensureGeoIndex(Iterable<String> fields, GeoIndexOptions options)
Creates a geo-spatial index for the collection, if it does not already exist.- Parameters:
fields
- A list of attribute pathsoptions
- Additional options, can be null- Returns:
- information about the index
- See Also:
- API Documentation
-
ensureFulltextIndex
@Deprecated IndexEntity ensureFulltextIndex(Iterable<String> fields, FulltextIndexOptions options)
Deprecated.since ArangoDB 3.10, use ArangoSearch or Inverted indexes instead.Creates a fulltext index for the collection, if it does not already exist.- Parameters:
fields
- A list of attribute pathsoptions
- Additional options, can be null- Returns:
- information about the index
- See Also:
- API Documentation
-
ensureTtlIndex
IndexEntity ensureTtlIndex(Iterable<String> fields, TtlIndexOptions options)
Creates a ttl index for the collection, if it does not already exist.- Parameters:
fields
- A list of attribute pathsoptions
- Additional options, can be null- Returns:
- information about the index
- See Also:
- API Documentation
-
ensureZKDIndex
IndexEntity ensureZKDIndex(Iterable<String> fields, ZKDIndexOptions options)
Creates a ZKD multi-dimensional index for the collection, if it does not already exist. Note that zkd indexes are an experimental feature in ArangoDB 3.9.- Parameters:
fields
- A list of attribute pathsoptions
- Additional options, can be null- Returns:
- information about the index
- Since:
- ArangoDB 3.9
- See Also:
- API Documentation
-
ensureInvertedIndex
InvertedIndexEntity ensureInvertedIndex(InvertedIndexOptions options)
Creates an inverted index for the collection, if it does not already exist.- Parameters:
options
- index creation options- Returns:
- information about the index
- Since:
- ArangoDB 3.10
- See Also:
- API Documentation
-
getIndexes
Collection<IndexEntity> getIndexes()
Fetches a list of all indexes on this collection.
Note: inverted indexes are not returned by this method. UsegetInvertedIndexes()
instead.- Returns:
- information about the indexes
- See Also:
- API Documentation
-
getInvertedIndexes
Collection<InvertedIndexEntity> getInvertedIndexes()
Fetches a list of all inverted indexes on this collection.- Returns:
- information about the indexes
- Since:
- ArangoDB 3.10
- See Also:
- API Documentation
-
exists
boolean exists()
Checks whether the collection exists- Returns:
- true if the collection exists, otherwise false
-
truncate
CollectionEntity truncate()
Removes all documents from the collection, but leaves the indexes intact- Returns:
- information about the collection
- See Also:
- API Documentation
-
truncate
CollectionEntity truncate(CollectionTruncateOptions options)
Removes all documents from the collection, but leaves the indexes intact- Parameters:
options
-- Returns:
- information about the collection
- Since:
- ArangoDB 3.5.0
- See Also:
- API Documentation
-
count
CollectionPropertiesEntity count()
Counts the documents in a collection- Returns:
- information about the collection, including the number of documents
- See Also:
- API Documentation
-
count
CollectionPropertiesEntity count(CollectionCountOptions options)
Counts the documents in a collection- Parameters:
options
-- Returns:
- information about the collection, including the number of documents
- Since:
- ArangoDB 3.5.0
- See Also:
- API Documentation
-
create
CollectionEntity create()
Creates a collection for this collection's name, then returns collection information from the server.- Returns:
- information about the collection
- See Also:
- API Documentation
-
create
CollectionEntity create(CollectionCreateOptions options)
Creates a collection with the givenoptions
for this collection's name, then returns collection information from the server.- Parameters:
options
- Additional options, can be null- Returns:
- information about the collection
- See Also:
- API Documentation
-
drop
void drop()
Deletes the collection from the database.- See Also:
- API Documentation
-
drop
void drop(boolean isSystem)
Deletes the collection from the database.- Parameters:
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.- Since:
- ArangoDB 3.1.0
- See Also:
- API Documentation
-
getInfo
CollectionEntity getInfo()
Returns information about the collection- Returns:
- information about the collection
- See Also:
- API Documentation
-
getProperties
CollectionPropertiesEntity getProperties()
Reads the properties of the specified collection- Returns:
- properties of the collection
- See Also:
- API Documentation
-
changeProperties
CollectionPropertiesEntity changeProperties(CollectionPropertiesOptions options)
Changes the properties of the collection- Parameters:
options
- Additional options, can be null- Returns:
- properties of the collection
- See Also:
- API Documentation
-
rename
CollectionEntity rename(String newName)
Renames the collection- Parameters:
newName
- The new name- Returns:
- information about the collection
- See Also:
- API Documentation
-
getResponsibleShard
ShardEntity getResponsibleShard(Object value)
Returns the responsible shard for the document. Please note that this API is only meaningful and available on a cluster coordinator.- Parameters:
value
- A projection of the document containing at least the shard key (_key or a custom attribute) for which the responsible shard should be determined- Returns:
- information about the responsible shard
- Since:
- ArangoDB 3.5.0
- See Also:
- API Documentation
-
getRevision
CollectionRevisionEntity getRevision()
Retrieve the collections revision- Returns:
- information about the collection, including the collections revision
- See Also:
- API Documentation
-
grantAccess
void grantAccess(String user, Permissions permissions)
Grants or revoke access to the collection for user user. You need permission to the _system database in order to execute this call.- Parameters:
user
- The name of the userpermissions
- The permissions the user grant- See Also:
- API Documentation
-
revokeAccess
void revokeAccess(String user)
Revokes access to the collection for user user. You need permission to the _system database in order to execute this call.- Parameters:
user
- The name of the user- See Also:
- API Documentation
-
resetAccess
void resetAccess(String user)
Clear the collection access level, revert back to the default access level.- Parameters:
user
- The name of the user- Since:
- ArangoDB 3.2.0
- See Also:
- API Documentation
-
getPermissions
Permissions getPermissions(String user)
Get the collection access level- Parameters:
user
- The name of the user- Returns:
- permissions of the user
- Since:
- ArangoDB 3.2.0
- See Also:
- API Documentation
-
-