You can use the schema manager to perform CRUD actions on indexes within a collection.
The schema manager supports the following index functions:
Create an index on the given collection
$arangoClient->schema()->createIndex(
'users',
[
'name' => 'email_persistent_unique',
'type' => 'persistent',
'fields' => ['profile.email'],
'unique' => true,
'sparse' => false
]
);
Delete an index by its ID.
$arangoClient->schema()->deleteIndex($id);
Get an index by its ID.
$arangoClient->schema()->getIndex($id);
Get an index by its name.
$arangoClient->schema()->getIndexByName('email_persistent_unique');
Get all indexes on a collection.
$arangoClient->schema()->getIndexes('users);