Class DefaultCollectionOperations
java.lang.Object
com.arangodb.springframework.core.template.DefaultCollectionOperations
- All Implemented Interfaces:
CollectionOperations
- Author:
- Mark Vollmary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DefaultCollectionOperations
(com.arangodb.ArangoCollection collection, Map<com.arangodb.springframework.core.template.CollectionCacheKey, com.arangodb.springframework.core.template.CollectionCacheValue> collectionCache, PersistenceExceptionTranslator exceptionTranslator) -
Method Summary
Modifier and TypeMethodDescriptionlong
count()
Counts the documents in a collectionvoid
drop()
Deletes the collection from the database.void
Deletes the index with the givenid
from the collection.com.arangodb.entity.IndexEntity
ensureFulltextIndex
(Iterable<String> fields, com.arangodb.model.FulltextIndexOptions options) Deprecated.com.arangodb.entity.IndexEntity
ensureGeoIndex
(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.IndexEntity
ensurePersistentIndex
(Iterable<String> fields, com.arangodb.model.PersistentIndexOptions options) Creates a persistent index for the collection, if it does not already exist.com.arangodb.entity.IndexEntity
ensureTtlIndex
(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.Permissions
getPermissions
(String username) Get the collection access levelcom.arangodb.entity.CollectionPropertiesEntity
Reads the properties of the specified collectionvoid
grantAccess
(String username, com.arangodb.entity.Permissions permissions) Grants or revoke access to the collection for user user.name()
Return the collection namevoid
resetAccess
(String username) Clear the collection access level, revert back to the default access level.void
truncate()
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:CollectionOperations
Return the collection name- Specified by:
name
in interfaceCollectionOperations
- Returns:
- collection name
-
drop
Description copied from interface:CollectionOperations
Deletes the collection from the database.- Specified by:
drop
in interfaceCollectionOperations
- Throws:
DataAccessException
-
truncate
Description copied from interface:CollectionOperations
Removes all documents from the collection, but leaves the indexes intact- Specified by:
truncate
in interfaceCollectionOperations
- Throws:
DataAccessException
-
count
Description copied from interface:CollectionOperations
Counts the documents in a collection- Specified by:
count
in interfaceCollectionOperations
- Returns:
- number of
- Throws:
DataAccessException
-
getProperties
Description copied from interface:CollectionOperations
Reads the properties of the specified collection- Specified by:
getProperties
in interfaceCollectionOperations
- Returns:
- properties of the collection
- Throws:
DataAccessException
-
getIndexes
Description copied from interface:CollectionOperations
Returns all indexes of the collection- Specified by:
getIndexes
in 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:CollectionOperations
Creates a persistent index for the collection, if it does not already exist.- Specified by:
ensurePersistentIndex
in 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:CollectionOperations
Creates a geo-spatial index for the collection, if it does not already exist.- Specified by:
ensureGeoIndex
in 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:CollectionOperations
Creates a fulltext index for the collection, if it does not already exist.- Specified by:
ensureFulltextIndex
in 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:CollectionOperations
Creates a ttl index for the collection, if it does not already exist.- Specified by:
ensureTtlIndex
in 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:CollectionOperations
Deletes the index with the givenid
from the collection.- Specified by:
dropIndex
in interfaceCollectionOperations
- Parameters:
id
- The index-handle- Throws:
DataAccessException
-
grantAccess
Description copied from interface:CollectionOperations
Grants or revoke access to the collection for user user. You need permission to the _system database in order to execute this call.- Specified by:
grantAccess
in interfaceCollectionOperations
- Parameters:
username
- The name of the userpermissions
- The permissions the user grant
-
resetAccess
Description copied from interface:CollectionOperations
Clear the collection access level, revert back to the default access level.- Specified by:
resetAccess
in interfaceCollectionOperations
- Parameters:
username
- The name of the user
-
getPermissions
Description copied from interface:CollectionOperations
Get the collection access level- Specified by:
getPermissions
in interfaceCollectionOperations
- Parameters:
username
- The name of the user- Returns:
- permissions of the user
- Throws:
DataAccessException
-