Developer

Querying The Database

Last updated on 27-Aug-2018 by fnl

To extract data from the database, use the datasetQuery function.

The function takes a class and a (optional) filter as parameters and returns an object containing entities that are not cancelled, that you have access rights to, and that fit the requested parameters.

An file containing different querying examples can be downloaded here.

Below is the datasetQuery interface:

Although marked as optional, the eClass parameter is necessary to complete the query. So is having either a collection, alias, or an entity parameter.

The eclass parameter marks the class of the queried entity.

The collection/alias/entity marks the name and type of the output.

The filters parameter is a list of filters that can be applied to the query. Below is the Filter interface:

field marks the value key on which to filter. value is a single accepted string while values is a list of accepted strings. in allows for iteration through an object. Finally, the op parameter allows for advanced searches. For instance, entities can be filteret by the first few letters of their name, or entities not made in a specific year can be found.

The sortings parameter is a list of Sorting objects and sorts the returned object. The Sorting interface can be seen below.

Each Sorting contains the name of the field on which to sort and a direction: 'asc' for ascending order, and 'desc' for descending order.