hasIndex
The hasIndex
method returns a boolean indicating whether a given Index
exists in the Indexes
object.
hasIndex(indexId: string): boolean
Type | Description | |
---|---|---|
indexId | string | |
returns | boolean | Whether an Index with that Id exists. |
This example shows two simple Index
existence checks.
const indexes = createIndexes(createStore());
indexes.setIndexDefinition('bySpecies', 'pets', 'species');
console.log(indexes.hasIndex('bySpecies'));
// -> true
console.log(indexes.hasIndex('byColor'));
// -> false