public class DefaultCollectionOperations extends Object implements CollectionOperations
Modifier | Constructor and Description |
---|---|
protected |
DefaultCollectionOperations(com.arangodb.ArangoCollection collection,
Map<com.arangodb.springframework.core.template.CollectionCacheKey,com.arangodb.springframework.core.template.CollectionCacheValue> collectionCache,
org.springframework.dao.support.PersistenceExceptionTranslator exceptionTranslator) |
Modifier and Type | Method and Description |
---|---|
long |
count()
Counts the documents in a collection
|
void |
drop()
Deletes the collection from the database.
|
void |
dropIndex(String id)
Deletes the index with the given
id from the collection. |
com.arangodb.entity.IndexEntity |
ensureFulltextIndex(Iterable<String> fields,
com.arangodb.model.FulltextIndexOptions options)
Creates a fulltext index for the collection, if it does not already exist.
|
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 |
ensureHashIndex(Iterable<String> fields,
com.arangodb.model.HashIndexOptions options)
Creates a hash 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 |
ensureSkiplistIndex(Iterable<String> fields,
com.arangodb.model.SkiplistIndexOptions options)
Creates a skip-list index for the collection, if it does not already exist.
|
Collection<com.arangodb.entity.IndexEntity> |
getIndexes()
Returns all indexes of the collection
|
com.arangodb.entity.Permissions |
getPermissions(String username)
Get the collection access level
|
com.arangodb.entity.CollectionPropertiesEntity |
getProperties()
Reads the properties of the specified collection
|
void |
grantAccess(String username,
com.arangodb.entity.Permissions permissions)
Grants or revoke access to the collection for user user.
|
String |
name()
Return the collection name
|
void |
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
|
protected DefaultCollectionOperations(com.arangodb.ArangoCollection collection, Map<com.arangodb.springframework.core.template.CollectionCacheKey,com.arangodb.springframework.core.template.CollectionCacheValue> collectionCache, org.springframework.dao.support.PersistenceExceptionTranslator exceptionTranslator)
public String name()
CollectionOperations
name
in interface CollectionOperations
public void drop() throws org.springframework.dao.DataAccessException
CollectionOperations
drop
in interface CollectionOperations
org.springframework.dao.DataAccessException
public void truncate() throws org.springframework.dao.DataAccessException
CollectionOperations
truncate
in interface CollectionOperations
org.springframework.dao.DataAccessException
public long count() throws org.springframework.dao.DataAccessException
CollectionOperations
count
in interface CollectionOperations
org.springframework.dao.DataAccessException
public com.arangodb.entity.CollectionPropertiesEntity getProperties() throws org.springframework.dao.DataAccessException
CollectionOperations
getProperties
in interface CollectionOperations
org.springframework.dao.DataAccessException
public Collection<com.arangodb.entity.IndexEntity> getIndexes() throws org.springframework.dao.DataAccessException
CollectionOperations
getIndexes
in interface CollectionOperations
org.springframework.dao.DataAccessException
public com.arangodb.entity.IndexEntity ensureHashIndex(Iterable<String> fields, com.arangodb.model.HashIndexOptions options) throws org.springframework.dao.DataAccessException
CollectionOperations
ensureHashIndex
in interface CollectionOperations
fields
- A list of attribute pathsoptions
- Additional options, can be nullorg.springframework.dao.DataAccessException
public com.arangodb.entity.IndexEntity ensureSkiplistIndex(Iterable<String> fields, com.arangodb.model.SkiplistIndexOptions options) throws org.springframework.dao.DataAccessException
CollectionOperations
ensureSkiplistIndex
in interface CollectionOperations
fields
- A list of attribute pathsoptions
- Additional options, can be nullorg.springframework.dao.DataAccessException
public com.arangodb.entity.IndexEntity ensurePersistentIndex(Iterable<String> fields, com.arangodb.model.PersistentIndexOptions options) throws org.springframework.dao.DataAccessException
CollectionOperations
ensurePersistentIndex
in interface CollectionOperations
fields
- A list of attribute pathsoptions
- Additional options, can be nullorg.springframework.dao.DataAccessException
public com.arangodb.entity.IndexEntity ensureGeoIndex(Iterable<String> fields, com.arangodb.model.GeoIndexOptions options) throws org.springframework.dao.DataAccessException
CollectionOperations
ensureGeoIndex
in interface CollectionOperations
fields
- A list of attribute pathsoptions
- Additional options, can be nullorg.springframework.dao.DataAccessException
public com.arangodb.entity.IndexEntity ensureFulltextIndex(Iterable<String> fields, com.arangodb.model.FulltextIndexOptions options) throws org.springframework.dao.DataAccessException
CollectionOperations
ensureFulltextIndex
in interface CollectionOperations
fields
- A list of attribute pathsoptions
- Additional options, can be nullorg.springframework.dao.DataAccessException
public void dropIndex(String id) throws org.springframework.dao.DataAccessException
CollectionOperations
id
from the collection.dropIndex
in interface CollectionOperations
id
- The index-handleorg.springframework.dao.DataAccessException
public void grantAccess(String username, com.arangodb.entity.Permissions permissions)
CollectionOperations
grantAccess
in interface CollectionOperations
username
- The name of the userpermissions
- The permissions the user grantpublic void resetAccess(String username)
CollectionOperations
resetAccess
in interface CollectionOperations
username
- The name of the userpublic com.arangodb.entity.Permissions getPermissions(String username) throws org.springframework.dao.DataAccessException
CollectionOperations
getPermissions
in interface CollectionOperations
username
- The name of the userorg.springframework.dao.DataAccessException
Copyright © 2017–2019 ArangoDB GmbH. All rights reserved.