collection.index

A collection index definition that defines the index name, terms, and values field schema.

Syntax

index <indexName> {
  [terms [<term> . . .]]
  [values [<value> . . .]]
}

Name

indexName String Required

Unique index name.

Properties

Property Type Required Description

terms

Array of field paths

Yes, if values is not defined.

Fields used for exact match searches.

See Indexes definition for defining ascending or descending order and multivalued attribute (MVA) flag.

values

Array of field paths

Yes, if terms is not defined.

Fields used for sorting and range searches.

See Indexes definition for defining ascending or descending order and multivalued attribute (MVA) flag.

Examples

index MyIndex {
  terms [.a.foo, .b, mva(.c.bar)]
  values [asc(.x), desc(mva(.y)), .z]
}

See also

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!