Download DHIS2 Developer Manual
Transcript
Web API Metadata object filter 1.7. Metadata object filter To filter the metadata there are several filter operations that can be applied to the returned list of metadata. The format of the filter itself is straight-forward and follows the pattern property:operator:value, where property is the property on the metadata you want to filter on, operator is the comparison operator you want to perform and value is the value to check against (not all operators require value). Please see the schema section to discover which properties are available. Recursive filtering, ie. filtering on associated objects or collection of objects, are supported as well. Table 1.8. Available Operators Operator Types Value required Description eq string | boolean | integer | float | enum | collection (checks for size) | date true Equality ne string | boolean | integer | float | collection (checks for size) | date true Inequality like / ilike string true Case insensitive string matching nlike string true Case insensitive string not matching startsWith string true Case insensitive string matching endsWith string true Case insensitive string matching gt string | boolean | integer | float | collection (checks for size) | date true Greater than ge string | boolean | integer | float | collection (checks for size) | date true Greater equal lt string | boolean | integer | float | collection (checks for size) | date true Less than le string | boolean | integer | float | collection (checks for size) | date true Less than or equal null all false Property is null empty collection false Collection is empty in string | boolean | integer | float | date true Find objects matching 1 or more values than or Operators will be applied as logical and query, if you need a or query, you can have a look at our in filter. The filtering mechanism allows for recursion. See below for some examples. Get data elements with id property ID1 or ID2: 9