See first Dataset basics tutorial for getting setup and initializing a Dataset.
The basic thing we want to do with Datasets is query and filter them. This is very easy to do:
This results in the following. Note how recordCount is now 3 (the total number of records matched by the query) but that records only contains 2 records as we restricted number of returned records using the size attribute.
A simple unstructured query like the one provided above searches all fieldsfor the value provided.
Often you want to “filter” results more precisely, for example by specifying a specific value in a specific field. To do this we use “filters”.
The last run query is stored as a Query
instance in the
queryState attribute of the Dataset object. Modifying
queryState will also resulting in a query being run. This is useful when
building views that want to display or manage the query state (see, for
example, Query Editor or Filter Editor widgets).
Full details of the query structure and its options can be found in the reference documentation.