TinyBase logoTinyBase

getStore

The getStore method returns a reference to the underlying Store that is backing this Relationships object.

getStore(): Store
returnsStore

A reference to the Store.

Example

This example creates a Relationships object against a newly-created Store and then gets its reference in order to update its data.

const relationships = createRelationships(createStore());
relationships.setRelationshipDefinition(
  'petSpecies',
  'pets',
  'species',
  'species',
);
relationships.getStore().setCell('pets', 'fido', 'species', 'dog');
console.log(relationships.getRemoteRowId('petSpecies', 'fido'));
// -> 'dog'