Secondary Key
Secondary Key indexes maintain a 1:1 relationship between a value of a field in the document and the document. No two documents may have the same value in a field that has a SKI.
If a document has a nullish value for a field that has a SKI index, it is ignored.
TypeScript
new Garak.SecondaryKeyIndex(
Store,
"fieldname"
);
Rust
garak::SecondaryKeyIndex::new(
&store,
"fieldname"
);
Index On
The field that secondary key indexes on will be enforced as unique. That means no two nodes may have the same value for that field.
If the indexed on field is an array, the individual values of the field are each mapped as secondary keys of the node. Uniqueness is still enforced.