resolveCollectionIndexes
resolveCollectionIndexes(
props):ResolvedCollectionIndex[]
Defined in: packages/core/src/collections/resolveCollectionIndexes.ts:53
Every index a collection declares, in schema order (collection-level entries
first, then field-level and automatic relationship indexes in field order), with
precedence applied: an explicit field-level index wins over a collection-level
indexes entry of the same name, which wins over a relationship field’s
automatic by_<fieldKey> index.
The one source of index truth. The schema generator, vex generate, access-rule
validation, the draft-status lookup and defineCollection all read it, so they
cannot disagree about which indexes exist. Fields inside tabs / row /
collapsible count under their data keys (getDataFields).
Parameters
Section titled “Parameters”Input props.
collection
Section titled “collection”{ fields: Record<string, AdminField>; indexes?: readonly object[]; slug: string; }
A collection, or a global (which declares no indexes).
collection.fields
Section titled “collection.fields”Record<string, AdminField>
collection.indexes?
Section titled “collection.indexes?”readonly object[]
collection.slug
Section titled “collection.slug”string
Returns
Section titled “Returns”The resolved indexes.
Throws
Section titled “Throws”When two fields declare the same index name; when a field-level
index takes another relationship field’s automatic name; when additionalFields
names an unknown field, the field itself, or a field twice; or when two
collection-level indexes entries share a name.