Interface CollectionOperations
- All Known Implementing Classes:
DefaultCollectionOperations
public interface CollectionOperations
Interface that specifies a basic set of ArangoDB operations on collection
level.
- Author:
- Mark Vollmary
-
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.since ArangoDB 3.10, use ArangoSearch or Inverted indexes instead.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
-
Method Details
-
name
String name()Return the collection name- Returns:
- collection name
-
drop
Deletes the collection from the database.- Throws:
DataAccessException
-
truncate
Removes all documents from the collection, but leaves the indexes intact- Throws:
DataAccessException
-
count
Counts the documents in a collection- Returns:
- number of
- Throws:
DataAccessException
-
getProperties
Reads the properties of the specified collection- Returns:
- properties of the collection
- Throws:
DataAccessException
-
getIndexes
Returns all indexes of the collection- Returns:
- information about the indexes
- Throws:
DataAccessException
-
ensurePersistentIndex
com.arangodb.entity.IndexEntity ensurePersistentIndex(Iterable<String> fields, com.arangodb.model.PersistentIndexOptions options) throws DataAccessException Creates a persistent index for the collection, if it does not already exist.- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
DataAccessException
-
ensureGeoIndex
com.arangodb.entity.IndexEntity ensureGeoIndex(Iterable<String> fields, com.arangodb.model.GeoIndexOptions options) throws DataAccessException Creates a geo-spatial index for the collection, if it does not already exist.- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
DataAccessException
-
ensureFulltextIndex
@Deprecated com.arangodb.entity.IndexEntity ensureFulltextIndex(Iterable<String> fields, com.arangodb.model.FulltextIndexOptions options) throws DataAccessException Deprecated.since ArangoDB 3.10, use ArangoSearch or Inverted indexes instead.Creates a fulltext index for the collection, if it does not already exist.- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
DataAccessException
-
ensureTtlIndex
com.arangodb.entity.IndexEntity ensureTtlIndex(Iterable<String> fields, com.arangodb.model.TtlIndexOptions options) throws DataAccessException Creates a ttl index for the collection, if it does not already exist.- Parameters:
fields- A list of attribute pathsoptions- Additional options, can be null- Returns:
- information about the index
- Throws:
DataAccessException
-
dropIndex
Deletes the index with the givenidfrom the collection.- Parameters:
id- The index-handle- Throws:
DataAccessException
-
grantAccess
void grantAccess(String username, com.arangodb.entity.Permissions permissions) throws DataAccessException Grants or revoke access to the collection for user user. You need permission to the _system database in order to execute this call.- Parameters:
username- The name of the userpermissions- The permissions the user grant- Throws:
DataAccessException
-
resetAccess
Clear the collection access level, revert back to the default access level.- Parameters:
username- The name of the user- Throws:
DataAccessException- Since:
- ArangoDB 3.2.0
-
getPermissions
Get the collection access level- Parameters:
username- The name of the user- Returns:
- permissions of the user
- Throws:
DataAccessException- Since:
- ArangoDB 3.2.0
-