public class ArangoCollection extends InternalArangoCollection<ArangoExecutorSync,Response,ConnectionSync>
executor
Modifier | Constructor and Description |
---|---|
protected |
ArangoCollection(ArangoDatabase db,
String name) |
Modifier and Type | Method and Description |
---|---|
CollectionPropertiesEntity |
changeProperties(CollectionPropertiesOptions options)
Changes the properties of a collection
|
CollectionPropertiesEntity |
count()
Counts the documents in a collection
|
IndexEntity |
createFulltextIndex(Collection<String> fields,
FulltextIndexOptions options)
Creates a fulltext index for the collection, if it does not already exist.
|
IndexEntity |
createGeoIndex(Collection<String> fields,
GeoIndexOptions options)
Creates a geo-spatial index for the collection, if it does not already exist.
|
IndexEntity |
createHashIndex(Collection<String> fields,
HashIndexOptions options)
Creates a hash index for the collection if it does not already exist.
|
IndexEntity |
createPersistentIndex(Collection<String> fields,
PersistentIndexOptions options)
Creates a persistent index for the collection, if it does not already exist.
|
IndexEntity |
createSkiplistIndex(Collection<String> fields,
SkiplistIndexOptions options)
Creates a skip-list index for the collection, if it does not already exist.
|
DocumentDeleteEntity<Void> |
deleteDocument(String key)
Removes a document
|
<T> DocumentDeleteEntity<T> |
deleteDocument(String key,
Class<T> type,
DocumentDeleteOptions options)
Removes a document
|
MultiDocumentEntity<DocumentDeleteEntity<Void>> |
deleteDocuments(Collection<?> values)
Removes multiple document
|
<T> MultiDocumentEntity<DocumentDeleteEntity<T>> |
deleteDocuments(Collection<?> values,
Class<T> type,
DocumentDeleteOptions options)
Removes multiple document
|
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()
Drops the collection
|
void |
drop(boolean isSystem)
Drops the collection
|
<T> T |
getDocument(String key,
Class<T> type)
Reads a single document
|
<T> T |
getDocument(String key,
Class<T> type,
DocumentReadOptions options)
Reads a single document
|
Collection<IndexEntity> |
getIndexes()
Returns all indexes of the collection
|
CollectionEntity |
getInfo()
Returns information about the collection
|
CollectionPropertiesEntity |
getProperties()
Reads the properties of the specified collection
|
CollectionRevisionEntity |
getRevision()
Retrieve the collections revision
|
DocumentImportEntity |
importDocuments(Collection<?> values)
Imports documents
|
DocumentImportEntity |
importDocuments(Collection<?> values,
DocumentImportOptions options)
Imports documents
|
DocumentImportEntity |
importDocuments(String values)
Imports documents
|
DocumentImportEntity |
importDocuments(String values,
DocumentImportOptions options)
Imports documents
|
<T> DocumentCreateEntity<T> |
insertDocument(T 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> 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> 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.
|
CollectionEntity |
load()
Loads a collection into memory.
|
CollectionEntity |
rename(String newName)
Renames a collection
|
<T> 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> 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> 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> 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.
|
CollectionEntity |
truncate()
Removes all documents from the collection, but leaves the indexes intact
|
CollectionEntity |
unload()
Removes a collection from memory.
|
<T> DocumentUpdateEntity<T> |
updateDocument(String key,
T value)
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.
|
<T> 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> 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.
|
changePropertiesRequest, countRequest, createFulltextIndexRequest, createGeoIndexRequest, createHashIndexRequest, createPersistentIndexRequest, createSkiplistIndexRequest, deleteDocumentRequest, deleteDocumentResponseDeserializer, deleteDocumentsRequest, deleteDocumentsResponseDeserializer, documentExistsRequest, dropRequest, getDocumentRequest, getIndexesRequest, getIndexesResponseDeserializer, getInfoRequest, getPropertiesRequest, getRevisionRequest, importDocumentsRequest, importDocumentsRequest, importDocumentsRequest, insertDocumentRequest, insertDocumentResponseDeserializer, insertDocumentsRequest, insertDocumentsResponseDeserializer, loadRequest, name, renameRequest, replaceDocumentRequest, replaceDocumentResponseDeserializer, replaceDocumentsRequest, replaceDocumentsResponseDeserializer, truncateRequest, unloadRequest, updateDocumentRequest, updateDocumentResponseDeserializer, updateDocumentsRequest, updateDocumentsResponseDeserializer
util
protected ArangoCollection(ArangoDatabase db, String name)
public <T> DocumentCreateEntity<T> insertDocument(T value) throws ArangoDBException
value
- A representation of a single document (POJO, VPackSlice or String for Json)ArangoDBException
public <T> DocumentCreateEntity<T> insertDocument(T value, DocumentCreateOptions options) throws ArangoDBException
value
- A representation of a single document (POJO, VPackSlice or String for Json)options
- Additional options, can be nullArangoDBException
public <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(Collection<T> values) throws ArangoDBException
values
- A List of documents (POJO, VPackSlice or String for Json)ArangoDBException
public <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(Collection<T> values, DocumentCreateOptions options) throws ArangoDBException
values
- A List of documents (POJO, VPackSlice or String for Json)options
- Additional options, can be nullArangoDBException
public DocumentImportEntity importDocuments(Collection<?> values) throws ArangoDBException
values
- a list of Objects that will be stored as documentsArangoDBException
public DocumentImportEntity importDocuments(Collection<?> values, DocumentImportOptions options) throws ArangoDBException
values
- a list of Objects that will be stored as documentsoptions
- Additional options, can be nullArangoDBException
public DocumentImportEntity importDocuments(String values) throws ArangoDBException
values
- JSON-encoded array of objects that will be stored as documentsArangoDBException
public DocumentImportEntity importDocuments(String values, DocumentImportOptions options) throws ArangoDBException
values
- JSON-encoded array of objects that will be stored as documentsoptions
- Additional options, can be nullArangoDBException
public <T> T getDocument(String key, Class<T> type)
key
- The key of the documenttype
- The type of the document (POJO class, VPackSlice or String for Json)ArangoDBException
public <T> 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
public <T> DocumentUpdateEntity<T> replaceDocument(String key, T value) throws ArangoDBException
key
- The key of the documentvalue
- A representation of a single document (POJO, VPackSlice or String for Json)ArangoDBException
public <T> DocumentUpdateEntity<T> replaceDocument(String key, T value, DocumentReplaceOptions options) throws ArangoDBException
key
- The key of the documentvalue
- A representation of a single document (POJO, VPackSlice or String for Json)options
- Additional options, can be nullArangoDBException
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(Collection<T> values) throws ArangoDBException
values
- A List of documents (POJO, VPackSlice or String for Json)ArangoDBException
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceDocuments(Collection<T> values, DocumentReplaceOptions options) throws ArangoDBException
values
- A List of documents (POJO, VPackSlice or String for Json)options
- Additional options, can be nullArangoDBException
public <T> DocumentUpdateEntity<T> updateDocument(String key, T value) throws ArangoDBException
key
- The key of the documentvalue
- A representation of a single document (POJO, VPackSlice or String for Json)ArangoDBException
public <T> DocumentUpdateEntity<T> updateDocument(String key, T value, DocumentUpdateOptions options) throws ArangoDBException
key
- The key of the documentvalue
- A representation of a single document (POJO, VPackSlice or String for Json)options
- Additional options, can be nullArangoDBException
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(Collection<T> values) throws ArangoDBException
values
- A list of documents (POJO, VPackSlice or String for Json)ArangoDBException
public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(Collection<T> values, DocumentUpdateOptions options) throws ArangoDBException
values
- A list of documents (POJO, VPackSlice or String for Json)options
- Additional options, can be nullArangoDBException
public DocumentDeleteEntity<Void> deleteDocument(String key) throws ArangoDBException
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 nullArangoDBException
public <T> DocumentDeleteEntity<T> deleteDocument(String key, Class<T> type, DocumentDeleteOptions options) throws ArangoDBException
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 nullArangoDBException
public MultiDocumentEntity<DocumentDeleteEntity<Void>> deleteDocuments(Collection<?> values) throws ArangoDBException
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.ArangoDBException
public <T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(Collection<?> values, Class<T> type, DocumentDeleteOptions options) throws ArangoDBException
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 nullArangoDBException
public Boolean documentExists(String key)
key
- The key of the documentpublic Boolean documentExists(String key, DocumentExistsOptions options)
key
- The key of the documentoptions
- Additional options, can be nullpublic IndexEntity createHashIndex(Collection<String> fields, HashIndexOptions options) throws ArangoDBException
fields
- A list of attribute pathsoptions
- Additional options, can be nullArangoDBException
public IndexEntity createSkiplistIndex(Collection<String> fields, SkiplistIndexOptions options) throws ArangoDBException
fields
- A list of attribute pathsoptions
- Additional options, can be nullArangoDBException
public IndexEntity createPersistentIndex(Collection<String> fields, PersistentIndexOptions options) throws ArangoDBException
fields
- A list of attribute pathsoptions
- Additional options, can be nullArangoDBException
public IndexEntity createGeoIndex(Collection<String> fields, GeoIndexOptions options) throws ArangoDBException
fields
- A list of attribute pathsoptions
- Additional options, can be nullArangoDBException
public IndexEntity createFulltextIndex(Collection<String> fields, FulltextIndexOptions options) throws ArangoDBException
fields
- A list of attribute pathsoptions
- Additional options, can be nullArangoDBException
public Collection<IndexEntity> getIndexes() throws ArangoDBException
ArangoDBException
public CollectionEntity truncate() throws ArangoDBException
ArangoDBException
public CollectionPropertiesEntity count() throws ArangoDBException
ArangoDBException
public void drop() throws ArangoDBException
ArangoDBException
public void drop(boolean isSystem) throws ArangoDBException
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.ArangoDBException
public CollectionEntity load() throws ArangoDBException
ArangoDBException
public CollectionEntity unload() throws ArangoDBException
ArangoDBException
public CollectionEntity getInfo() throws ArangoDBException
ArangoDBException
public CollectionPropertiesEntity getProperties() throws ArangoDBException
ArangoDBException
public CollectionPropertiesEntity changeProperties(CollectionPropertiesOptions options) throws ArangoDBException
options
- Additional options, can be nullArangoDBException
public CollectionEntity rename(String newName) throws ArangoDBException
newName
- The new nameArangoDBException
public CollectionRevisionEntity getRevision() throws ArangoDBException
ArangoDBException
Copyright © 2016–2017 ArangoDB GmbH. All rights reserved.