TinyBase logoTinyBase

getQueryIds

The getQueryIds method returns an array of the query Ids registered with this Queries object.

getQueryIds(): Ids
returnsIds

An array of Ids.

Example

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

const queries = createQueries(createStore())
  .setQueryDefinition('dogColors', 'pets', ({select, where}) => {
    select('color');
    where('species', 'dog');
  })
  .setQueryDefinition('catColors', 'pets', ({select, where}) => {
    select('color');
    where('species', 'cat');
  });

console.log(queries.getQueryIds());
// -> ['dogColors', 'catColors']

Since

v2.0.0