TinyBase logoTinyBase

getRelationshipIds

The getRelationshipIds method returns an array of the Relationship Ids registered with this Relationships object.

getRelationshipIds(): Ids
returnsIds

An array of Ids.

Example

This example creates a Relationships object with two definitions, and then gets the Ids of the definitions.

const relationships = createRelationships(createStore())
  .setRelationshipDefinition('petSpecies', 'pets', 'species', 'species')
  .setRelationshipDefinition('petSequence', 'pets', 'pets', 'next');
console.log(relationships.getRelationshipIds());
// -> ['petSpecies', 'petSequence']