Class DefaultCollectionOperations
java.lang.Object
com.arangodb.springframework.core.template.DefaultCollectionOperations
- All Implemented Interfaces:
CollectionOperations
- Author:
- Mark Vollmary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultCollectionOperations(com.arangodb.ArangoCollection collection, Map<com.arangodb.springframework.core.template.CollectionCacheKey, com.arangodb.springframework.core.template.CollectionCacheValue> collectionCache, PersistenceExceptionTranslator exceptionTranslator) -
Method Summary
Modifier and TypeMethodDescriptionlongcount()Counts the documents in a collectionvoiddrop()Deletes the collection from the database.voidDeletes the index with the givenidfrom the collection.com.arangodb.entity.IndexEntityensureFulltextIndex(Iterable<String> fields, com.arangodb.model.FulltextIndexOptions options) Deprecated.com.arangodb.entity.IndexEntityensureGeoIndex(Iterable<String> fields, com.arangodb.model.GeoIndexOptions options) Creates a geo-spatial index for the collection, if it does not already exist.com.arangodb.entity.IndexEntityensurePersistentIndex(Iterable<String> fields, com.arangodb.model.PersistentIndexOptions options) Creates a persistent index for the collection, if it does not already exist.com.arangodb.entity.IndexEntityensureTtlIndex(Iterable<String> fields, com.arangodb.model.TtlIndexOptions options) Creates a ttl index for the collection, if it does not already exist.Collection<com.arangodb.entity.IndexEntity>Returns all indexes of the collectioncom.arangodb.entity.PermissionsgetPermissions(String username) Get the collection access levelcom.arangodb.entity.CollectionPropertiesEntityReads the properties of the specified collectionvoidgrantAccess(String username, com.arangodb.entity.Permissions permissions) Grants or revoke access to the collection for user user.name()Return the collection namevoidresetAccess(String username) Clear the collection access level, revert back to the default access level.voidtruncate()Removes all documents from the collection, but leaves the indexes intact
-
Constructor Details
-
DefaultCollectionOperations
protected DefaultCollectionOperations(com.arangodb.ArangoCollection collection, Map<com.arangodb.springframework.core.template.CollectionCacheKey, com.arangodb.springframework.core.template.CollectionCacheValue> collectionCache, PersistenceExceptionTranslator exceptionTranslator)
-
-
Method Details
-
name
Description copied from interface:CollectionOperationsReturn the collection name- Specified by:
namein interfaceCollectionOperations- Returns:
- collection name
-
drop
Description copied from interface:CollectionOperationsDeletes the collection from the database.- Specified by:
dropin interfaceCollectionOperations- Throws:
DataAccessException
-
truncate
Description copied from interface:CollectionOperationsRemoves all documents from the collection, but leaves the indexes intact- Specified by:
truncatein interfaceCollectionOperations- Throws:
DataAccessException
-
count
Description copied from interface:CollectionOperationsCounts the documents in a collection- Specified by:
countin interfaceCollectionOperations- Returns:
- number of
- Throws:
DataAccessException
-
getProperties
Description copied from interface:CollectionOperationsReads the properties of the specified collection- Specified by:
getPropertiesin interfaceCollectionOperations- Returns:
- properties of the collection
- Throws:
DataAccessException
-
getIndexes
Description copied from interface:CollectionOperationsReturns all indexes of the collection- Specified by:
getIndexesin interfaceCollectionOperations- Returns:
- information about the indexes
- Throws:
DataAccessException
-
ensurePersistentIndex
public com.arangodb.entity.IndexEntity ensurePersistentIndex(Iterable<String> fields, com.arangodb.model.PersistentIndexOptions options) throws DataAccessException Description copied from interface:CollectionOperationsCreates a persistent index for the collection, if it does not already exist.- Specified by:
ensurePersistentIndexin interfaceCollectionOperations- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
DataAccessException
-
ensureGeoIndex
public com.arangodb.entity.IndexEntity ensureGeoIndex(Iterable<String> fields, com.arangodb.model.GeoIndexOptions options) throws DataAccessException Description copied from interface:CollectionOperationsCreates a geo-spatial index for the collection, if it does not already exist.- Specified by:
ensureGeoIndexin interfaceCollectionOperations- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
DataAccessException
-
ensureFulltextIndex
@Deprecated public com.arangodb.entity.IndexEntity ensureFulltextIndex(Iterable<String> fields, com.arangodb.model.FulltextIndexOptions options) throws DataAccessException Deprecated.Description copied from interface:CollectionOperationsCreates a fulltext index for the collection, if it does not already exist.- Specified by:
ensureFulltextIndexin interfaceCollectionOperations- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
DataAccessException
-
ensureTtlIndex
public com.arangodb.entity.IndexEntity ensureTtlIndex(Iterable<String> fields, com.arangodb.model.TtlIndexOptions options) throws DataAccessException Description copied from interface:CollectionOperationsCreates a ttl index for the collection, if it does not already exist.- Specified by:
ensureTtlIndexin interfaceCollectionOperations- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
DataAccessException
-
dropIndex
Description copied from interface:CollectionOperationsDeletes the index with the givenidfrom the collection.- Specified by:
dropIndexin interfaceCollectionOperations- Parameters:
id- The index-handle- Throws:
DataAccessException
-
grantAccess
Description copied from interface:CollectionOperationsGrants or revoke access to the collection for user user. You need permission to the _system database in order to execute this call.- Specified by:
grantAccessin interfaceCollectionOperations- Parameters:
username- The name of the userpermissions- The permissions the user grant
-
resetAccess
Description copied from interface:CollectionOperationsClear the collection access level, revert back to the default access level.- Specified by:
resetAccessin interfaceCollectionOperations- Parameters:
username- The name of the user
-
getPermissions
Description copied from interface:CollectionOperationsGet the collection access level- Specified by:
getPermissionsin interfaceCollectionOperations- Parameters:
username- The name of the user- Returns:
- permissions of the user
- Throws:
DataAccessException
-