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 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.since ArangoDB 3.10, use ArangoSearch or Inverted indexes instead.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
-
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 givenid
from 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
-