Indexes are used to allow fast access to documents. For each collection there is always the primary index which is a hash index of the document identifiers.

Usage example:

from arango import create

# here we define connection to Arango
c = create()

# here we creating collection explicitly

# create `hash` index for two fields: `name` and `num`,
# not unque
c.test.index.create(["name", "num"])

# create unique `hash` index for `slug` field
class arango.index.Index(collection=None)

Interface to work with Indexes


Get list of all available indexes. Returns tuple with indentyfiers and original response

create(fields, index_type='hash', unique=False)

Create new index. By default type is hash and unique=False

fields may be either str, list or tuple.

This method may generate WrongIndexType exception in case index_type isn’t allowed for Arango DB


Return tuple of two values: - bool success or not deletion - original response

get(field_id, force_read=False)

Get index by id