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 Type
    Method
    Description
    long
    Counts the documents in a collection
    void
    Deletes the collection from the database.
    void
    Deletes the index with the given id 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 collection
    com.arangodb.entity.Permissions
    Get the collection access level
    com.arangodb.entity.CollectionPropertiesEntity
    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.
    Return the collection name
    void
    resetAccess(String username)
    Clear the collection access level, revert back to the default access level.
    void
    Removes all documents from the collection, but leaves the indexes intact
  • Method Details

    • name

      String name()
      Return the collection name
      Returns:
      collection name
    • drop

      void drop() throws DataAccessException
      Deletes the collection from the database.
      Throws:
      DataAccessException
    • truncate

      void truncate() throws DataAccessException
      Removes all documents from the collection, but leaves the indexes intact
      Throws:
      DataAccessException
    • count

      long count() throws DataAccessException
      Counts the documents in a collection
      Returns:
      number of
      Throws:
      DataAccessException
    • getProperties

      com.arangodb.entity.CollectionPropertiesEntity getProperties() throws DataAccessException
      Reads the properties of the specified collection
      Returns:
      properties of the collection
      Throws:
      DataAccessException
    • getIndexes

      Collection<com.arangodb.entity.IndexEntity> getIndexes() throws DataAccessException
      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 paths
      options - 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 paths
      options - 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 paths
      options - 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 paths
      options - Additional options, can be null
      Returns:
      information about the index
      Throws:
      DataAccessException
    • dropIndex

      void dropIndex(String id) throws DataAccessException
      Deletes the index with the given id 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 user
      permissions - The permissions the user grant
      Throws:
      DataAccessException
    • resetAccess

      void resetAccess(String username) throws DataAccessException
      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

      com.arangodb.entity.Permissions getPermissions(String username) throws DataAccessException
      Get the collection access level
      Parameters:
      username - The name of the user
      Returns:
      permissions of the user
      Throws:
      DataAccessException
      Since:
      ArangoDB 3.2.0