|
Does cbl-dart support multi-field index? Suppose I want to index on lastName, then firstName in one index. |
Answered by
blaugold
May 29, 2022
Replies: 1 comment 1 reply
|
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. |
1 reply
Answer selected by
natgross
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, multi-field indexes are supported. You have two options for the syntax to specify an index: N1QL or query builder expressions.
I don't think that it's possible to specify a sort direction for indexes, but I'll look into that.