Indexes are used to allow fast access to documents. For each collection there is always the primary index which is a hash index for the document identifier.
Usage example:
from arango import create
# here we define connection to Arango
c = create()
# here we creating collection explicitly
c.test.create()
# create `hash` index for two fields: `name` and `num`,
# not unque
c.test.index.create(["name", "num"])
# create unique `hash` index for `slug` field
c.test.index.create(
"slug",
index_type="hash",
unique=True
)
Interface to work with Indexes
Get list of all available indexes. Returns tuple with indentyfiers and original response
...
c.test.index()
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 index by id