getTableId
The getTableId method returns the Id
of the underlying Table
that is backing an Index
.
getTableId(indexId: string): string
Type | Description | |
---|---|---|
indexId | string | |
returns | string | The Id of the Table backing the Index, or `undefined`. |
If the Index
Id
is invalid, the method returns undefined
.
This example creates an Indexes
object, a single Index
definition, and then queries it (and a non-existent definition) to get the underlying Table
Id
.
const indexes = createIndexes(createStore());
indexes.setIndexDefinition('bySpecies', 'pets', 'species');
console.log(indexes.getTableId('bySpecies'));
// -> 'pets'
console.log(indexes.getTableId('byColor'));
// -> undefined