IndexDefinition
Common contract for every index definition consumable by {@see \oihana\arango\clients\collection\Collection::createIndex()}.
Implementations are expected to be immutable value objects whose
single responsibility is to serialise themselves into the body shape
expected by POST /_api/index. The HTTP layer takes the resulting
array and forwards it as JSON.
Tags
Table of Contents
Methods
- toArray() : array<string, mixed>
- Returns the request body for `POST /_api/index` corresponding to this index definition.
Methods
toArray()
Returns the request body for `POST /_api/index` corresponding to this index definition.
public
toArray() : array<string, mixed>
Implementations MUST set the type field (typically through
IndexType)
and the fields array. Every other key is optional and must be
omitted from the output when the underlying property is null,
so the server applies its default.