public interface CollectionOperations
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
|
String name()
void drop() throws DataAccessException
DataAccessException
void truncate() throws DataAccessException
DataAccessException
long count() throws DataAccessException
DataAccessException
com.arangodb.entity.CollectionPropertiesEntity getProperties() throws DataAccessException
DataAccessException
Collection<com.arangodb.entity.IndexEntity> getIndexes() throws DataAccessException
DataAccessException
com.arangodb.entity.IndexEntity ensureHashIndex(Iterable<String> fields, com.arangodb.model.HashIndexOptions options) throws DataAccessException
fields
- A list of attribute pathsoptions
- Additional options, can be nullDataAccessException
com.arangodb.entity.IndexEntity ensureSkiplistIndex(Iterable<String> fields, com.arangodb.model.SkiplistIndexOptions options) throws DataAccessException
fields
- A list of attribute pathsoptions
- Additional options, can be nullDataAccessException
com.arangodb.entity.IndexEntity ensurePersistentIndex(Iterable<String> fields, com.arangodb.model.PersistentIndexOptions options) throws DataAccessException
fields
- A list of attribute pathsoptions
- Additional options, can be nullDataAccessException
com.arangodb.entity.IndexEntity ensureGeoIndex(Iterable<String> fields, com.arangodb.model.GeoIndexOptions options) throws DataAccessException
fields
- A list of attribute pathsoptions
- Additional options, can be nullDataAccessException
com.arangodb.entity.IndexEntity ensureFulltextIndex(Iterable<String> fields, com.arangodb.model.FulltextIndexOptions options) throws DataAccessException
fields
- A list of attribute pathsoptions
- Additional options, can be nullDataAccessException
void dropIndex(String id) throws DataAccessException
id
from the collection.id
- The index-handleDataAccessException
void grantAccess(String username, com.arangodb.entity.Permissions permissions) throws DataAccessException
username
- The name of the userpermissions
- The permissions the user grantDataAccessException
void resetAccess(String username) throws DataAccessException
username
- The name of the userDataAccessException
com.arangodb.entity.Permissions getPermissions(String username) throws DataAccessException
username
- The name of the userDataAccessException
Copyright © 2017–2020 ArangoDB GmbH. All rights reserved.