Skip to content
Discussion options

You must be logged in to vote

Yes, multi-field indexes are supported. You have two options for the syntax to specify an index: N1QL or query builder expressions.

// Query builder syntax
database.createIndex('User:Name', ValueIndex([
  ValueIndexItem.property('firstName'),
  ValueIndexItem.property('lastName'),
]));

// N1QL syntax
database.createIndex('User:Name', ValueIndexConfiguration([
  'firstName',
  'lastName',
]));

I don't think that it's possible to specify a sort direction for indexes, but I'll look into that.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@blaugold
Comment options

Answer selected by natgross
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #383 on May 29, 2022 17:31.