Data

Find the schema with name tests and only select id, name and transitions

const schema = await sdk.data.schemas.findByName("tests", {
  rql: rqlBuilder().select(["id", "name", "transitions"]).build(),
});

console.log(schema.transitions);
// [{ id: '1', name:'trans1' }, { id: '1', name: 'trans2'}]

console.log(schema.transitionsByName);
/* {
  trans1: {
    id: '1',
    name: 'trans1'
  },
  trans2: {
    id: '2',
    name: 'trans2'
  }
} */

Find a document with custom data typing:

Transition a document based on data.deviceUid

Find all schemas

Find all schemas with Iterator

More info on Iteratorsarrow-up-right

Custom Iterator

Find with pagination

For Schema, Documents and Users the find function returns and object with the initial data and two helpers function to get the previous / next page.

Or if you are using the Asyncarrow-up-right package.

You can also pass in an offset (for example when you were processing items and something went wrong and want to resume where you left off)

Last updated