@ThreadSafe public interface ArangoCollection extends ArangoSerdeAccessor
Modifier and Type | Method and Description |
---|---|
CollectionPropertiesEntity |
changeProperties(CollectionPropertiesOptions options)
Changes the properties of the collection
|
CollectionPropertiesEntity |
count()
Counts the documents in a collection
|
CollectionPropertiesEntity |
count(CollectionCountOptions options)
Counts the documents in a collection
|
CollectionEntity |
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 given
options for this collection's name, then returns collection
information from the server. |
ArangoDatabase |
db()
The the handler of the database the collection is within
|
DocumentDeleteEntity<Void> |
deleteDocument(String key)
Deletes the document with the given
key from the collection. |
DocumentDeleteEntity<Void> |
deleteDocument(String key,
DocumentDeleteOptions options)
Deletes the document with the given
key from the collection. |
<T> DocumentDeleteEntity<T> |
deleteDocument(String key,
DocumentDeleteOptions options,
Class<T> type)
Deletes the document with the given
key 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.
|
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.
|
String |
deleteIndex(String id)
Deletes the index with the given
id from the collection. |
Boolean |
documentExists(String key)
Checks if the document exists by reading a single document head
|
Boolean |
documentExists(String key,
DocumentExistsOptions options)
Checks if the document exists by reading a single document head
|
void |
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.
|
IndexEntity |
ensureHashIndex(Iterable<String> fields,
HashIndexOptions options)
Deprecated.
use
ensurePersistentIndex(Iterable, PersistentIndexOptions) instead. Since ArangoDB 3.7 a
hash index is an alias for a persistent index. |
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 |
ensureSkiplistIndex(Iterable<String> fields,
SkiplistIndexOptions options)
Deprecated.
use
ensurePersistentIndex(Iterable, PersistentIndexOptions) instead. Since ArangoDB 3.7 a
skiplist index is an alias for a persistent index. |
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 given
key from the collection. |
<T> T |
getDocument(String key,
Class<T> type,
DocumentReadOptions options)
Retrieves the document with the given
key 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 given
id and returns it. |
Collection<IndexEntity> |
getIndexes()
Fetches a list of all indexes on this collection.
|
CollectionEntity |
getInfo()
Returns information about the collection
|
InvertedIndexEntity |
getInvertedIndex(String id)
Fetches information about the inverted index with the given
id and returns it. |
Collection<InvertedIndexEntity> |
getInvertedIndexes()
Fetches a list of all inverted indexes on this collection.
|
Permissions |
getPermissions(String user)
Get the collection access level
|
CollectionPropertiesEntity |
getProperties()
Reads the properties of the specified collection
|
ShardEntity |
getResponsibleShard(Object value)
Returns the responsible shard for the document.
|
CollectionRevisionEntity |
getRevision()
Retrieve the collections revision
|
void |
grantAccess(String user,
Permissions permissions)
Grants or revoke access to the collection for user user.
|
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.
|
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.
|
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(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.
|
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.
|
String |
name()
The name of the collection
|
CollectionEntity |
rename(String newName)
Renames the collection
|
DocumentUpdateEntity<Void> |
replaceDocument(String key,
Object value)
Replaces the document with
key 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 with
key 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 with
key with the one in the body, provided there is such a document and no
precondition is violated |
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.
|
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.
|
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.
|
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 intact
|
CollectionEntity |
truncate(CollectionTruncateOptions options)
Removes all documents from the collection, but leaves the indexes intact
|
DocumentUpdateEntity<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(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.
|
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.
|
getSerde
ArangoDatabase db()
String name()
DocumentCreateEntity<Void> insertDocument(Object value)
value
- A representation of a single document (POJO or RawData
<T> DocumentCreateEntity<T> insertDocument(T value, DocumentCreateOptions options)
value
- A representation of a single document (POJO or RawData
)options
- Additional options<T> DocumentCreateEntity<T> insertDocument(T value, DocumentCreateOptions options, Class<T> type)
value
- A representation of a single document (POJO or RawData
)options
- Additional optionstype
- Deserialization target type for the returned documents.MultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(RawData values)
values
- Raw data representing a collection of documentsMultiDocumentEntity<DocumentCreateEntity<RawData>> insertDocuments(RawData values, DocumentCreateOptions options)
values
- Raw data representing a collection of documentsoptions
- Additional optionsMultiDocumentEntity<DocumentCreateEntity<Void>> insertDocuments(Collection<?> values)
values
- A List of documents<T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(Collection<T> values, DocumentCreateOptions options)
values
- A List of documents (POJO or RawData
)options
- Additional options<T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(Collection<T> values, DocumentCreateOptions options, Class<T> type)
values
- A List of documents (POJO or RawData
)options
- Additional optionstype
- Deserialization target type for the returned documents.DocumentImportEntity importDocuments(Collection<?> values)
values
- A List of documents (POJO or RawData
)DocumentImportEntity importDocuments(Collection<?> values, DocumentImportOptions options)
values
- A List of documents (POJO or RawData
)options
- Additional options, can be nullDocumentImportEntity importDocuments(RawData values)
values
- Raw data representing a collection of documentsDocumentImportEntity importDocuments(RawData values, DocumentImportOptions options)
values
- Raw data representing a collection of documentsoptions
- Additional options, can be null<T> T getDocument(String key, Class<T> type)
key
from the collection.key
- The key of the documenttype
- The type of the document (POJO or RawData
)<T> T getDocument(String key, Class<T> type, DocumentReadOptions options)
key
from the collection.key
- The key of the documenttype
- The type of the document (POJO or RawData
)options
- Additional options, can be null<T> MultiDocumentEntity<T> getDocuments(Collection<String> keys, Class<T> type)
_key
from the collection.keys
- The keys of the documentstype
- The type of the documents (POJO or RawData
)<T> MultiDocumentEntity<T> getDocuments(Collection<String> keys, Class<T> type, DocumentReadOptions options)
_key
from the collection.keys
- The keys of the documentstype
- The type of the documents (POJO or RawData
)options
- Additional options, can be nullDocumentUpdateEntity<Void> replaceDocument(String key, Object value)
key
with the one in the body, provided there is such a document and no
precondition is violatedkey
- The key of the documentvalue
- A representation of a single document (POJO or RawData
)<T> DocumentUpdateEntity<T> replaceDocument(String key, T value, DocumentReplaceOptions options)
key
with the one in the body, provided there is such a document and no
precondition is violatedkey
- The key of the documentvalue
- A representation of a single document (POJO or RawData
)options
- Additional options<T> DocumentUpdateEntity<T> replaceDocument(String key, T value, DocumentReplaceOptions options, Class<T> type)
key
with the one in the body, provided there is such a document and no
precondition is violatedkey
- The key of the documentvalue
- A representation of a single document (POJO or RawData
)options
- Additional optionstype
- Deserialization target type for the returned documents.MultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(RawData values)
values
- Raw data representing a collection of documentsMultiDocumentEntity<DocumentUpdateEntity<RawData>> replaceDocuments(RawData values, DocumentReplaceOptions options)
values
- Raw data representing a collection of documentsoptions
- Additional optionsMultiDocumentEntity<DocumentUpdateEntity<Void>> replaceDocuments(Collection<?> values)
values
- A List of documents (POJO or RawData
)<T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(Collection<T> values, DocumentReplaceOptions options)
values
- A List of documents (POJO or RawData
)options
- Additional options<T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(Collection<T> values, DocumentReplaceOptions options, Class<T> type)
values
- A List of documents (POJO or RawData
)options
- Additional optionstype
- Deserialization target type for the returned documents.DocumentUpdateEntity<Void> updateDocument(String key, Object value)
key
- The key of the documentvalue
- A representation of a single document (POJO or RawData
)<T> DocumentUpdateEntity<T> updateDocument(String key, T value, DocumentUpdateOptions options)
key
- The key of the documentvalue
- A representation of a single document (POJO or RawData
)options
- Additional options<T> DocumentUpdateEntity<T> updateDocument(String key, Object value, DocumentUpdateOptions options, Class<T> returnType)
key
- The key of the documentvalue
- A representation of a single document (POJO or RawData
)options
- Additional optionsreturnType
- Type of the returned newDocument and/or oldDocumentMultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(RawData values)
values
- Raw data representing a collection of documentsMultiDocumentEntity<DocumentUpdateEntity<RawData>> updateDocuments(RawData values, DocumentUpdateOptions options)
values
- Raw data representing a collection of documentsoptions
- Additional optionsMultiDocumentEntity<DocumentUpdateEntity<Void>> updateDocuments(Collection<?> values)
values
- A list of documents (POJO or RawData
)<T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(Collection<T> values, DocumentUpdateOptions options)
values
- A list of documents (POJO or RawData
)options
- Additional options<T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(Collection<?> values, DocumentUpdateOptions options, Class<T> returnType)
values
- A list of documents (POJO or RawData
)options
- Additional optionsreturnType
- Type of the returned newDocument and/or oldDocumentDocumentDeleteEntity<Void> deleteDocument(String key)
key
from the collection.key
- The key of the documentDocumentDeleteEntity<Void> deleteDocument(String key, DocumentDeleteOptions options)
key
from the collection.key
- The key of the documentoptions
- Additional options<T> DocumentDeleteEntity<T> deleteDocument(String key, DocumentDeleteOptions options, Class<T> type)
key
from the collection.key
- The key of the documenttype
- Deserialization target type for the returned documents.options
- Additional optionsMultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(RawData values)
values
- Raw data representing the keys of the documents or the documents themselvesMultiDocumentEntity<DocumentDeleteEntity<RawData>> deleteDocuments(RawData values, DocumentDeleteOptions options)
values
- Raw data representing the keys of the documents or the documents themselvesoptions
- Additional optionsMultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(Collection<?> values)
values
- The keys of the documents or the documents themselves<T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(Collection<?> values, DocumentDeleteOptions options)
values
- The keys of the documents or the documents themselvesoptions
- Additional options<T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(Collection<?> values, DocumentDeleteOptions options, Class<T> type)
values
- The keys of the documents or the documents themselvestype
- Deserialization target type for the returned documents.options
- Additional optionsBoolean documentExists(String key)
key
- The key of the documentBoolean documentExists(String key, DocumentExistsOptions options)
key
- The key of the documentoptions
- Additional options, can be nullIndexEntity getIndex(String id)
id
and returns it.
getInvertedIndex(String)
instead.id
- The index-handleInvertedIndexEntity getInvertedIndex(String id)
id
and returns it.id
- The index-handleString deleteIndex(String id)
id
from the collection.id
- The index-handle@Deprecated IndexEntity ensureHashIndex(Iterable<String> fields, HashIndexOptions options)
ensurePersistentIndex(Iterable, PersistentIndexOptions)
instead. Since ArangoDB 3.7 a
hash index is an alias for a persistent index.fields
- A list of attribute pathsoptions
- Additional options, can be null@Deprecated IndexEntity ensureSkiplistIndex(Iterable<String> fields, SkiplistIndexOptions options)
ensurePersistentIndex(Iterable, PersistentIndexOptions)
instead. Since ArangoDB 3.7 a
skiplist index is an alias for a persistent index.fields
- A list of attribute pathsoptions
- Additional options, can be nullIndexEntity ensurePersistentIndex(Iterable<String> fields, PersistentIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be nullIndexEntity ensureGeoIndex(Iterable<String> fields, GeoIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be null@Deprecated IndexEntity ensureFulltextIndex(Iterable<String> fields, FulltextIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be nullIndexEntity ensureTtlIndex(Iterable<String> fields, TtlIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be nullIndexEntity ensureZKDIndex(Iterable<String> fields, ZKDIndexOptions options)
fields
- A list of attribute pathsoptions
- Additional options, can be nullInvertedIndexEntity ensureInvertedIndex(InvertedIndexOptions options)
options
- index creation optionsCollection<IndexEntity> getIndexes()
getInvertedIndexes()
instead.Collection<InvertedIndexEntity> getInvertedIndexes()
boolean exists()
CollectionEntity truncate()
CollectionEntity truncate(CollectionTruncateOptions options)
options
- CollectionPropertiesEntity count()
CollectionPropertiesEntity count(CollectionCountOptions options)
options
- CollectionEntity create()
CollectionEntity create(CollectionCreateOptions options)
options
for this collection's name, then returns collection
information from the server.options
- Additional options, can be nullvoid drop()
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.CollectionEntity getInfo()
CollectionPropertiesEntity getProperties()
CollectionPropertiesEntity changeProperties(CollectionPropertiesOptions options)
options
- Additional options, can be nullCollectionEntity rename(String newName)
newName
- The new nameShardEntity 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 determinedCollectionRevisionEntity getRevision()
void grantAccess(String user, Permissions permissions)
user
- The name of the userpermissions
- The permissions the user grantvoid revokeAccess(String user)
user
- The name of the uservoid resetAccess(String user)
user
- The name of the userPermissions getPermissions(String user)
user
- The name of the userCopyright © 2016–2023 ArangoDB GmbH. All rights reserved.