QUERY

Querying an AirData App Object returns the App Object instances that fit the query parameters.

Query Properties

App Object

Expects type object.

Sets which AirData App Object will be queried

Paginate Type

If Limit Offset is selected, limits the number of rows returned from a query and omit a specified number of rows.

Paginate Limit

  • type: int

  • description: Limit the number of pages to return in a query

Paginate Offset

  • type: int

  • default: 0

  • description: Depth into the result set to return

Query Limit

  • type: int

  • default: 100

  • description: Maximum number of results to return in a given page

Data can be queried using the Visual Query Builder as well as the Expression Editor.

Visual Query Builder

Visual Query Builder provides a visual representation of grouping and querying data in AirData.

The query can either be an AND query or an OR query. AND will query all records if all group conditions are TRUE. OR will display records if any of the group conditions are TRUE

When Adding groups, fields can be combined to create more precise filters. For example, the image below represents a query that will return all records where the score = 10 AND returning_customer = true OR score > 8..

Expression Editor

The Expression Editor allows you to use Airscript to filter the data returned by AirData queries. Queries consist of the following components:

filterKeyWord: the primary name for the filter.

type: the Airkit data type of the field that you wish to query (text, list of texts, etc)

aliases: can be used to clarify the intent of or shorten your query using different filter key words.

For example, the following queries will operate identically:

{ "age": { "<": 2 } }
{ "age": { "lessThan": 2 } }

example query: A valid sample query based on the example datastore.

query returns: A description of what the sample query would return from example datastore.

String matching filters

FilterDescriptionAliasesTypeExample

anyOf

strict equality test

=, in, any, eq

T | Collection where T = type of field

{ "breed": { "anyOf": ["mutt" , "pug"] } } All dogs exactly matching the string "mutt" or "pug" in the "breed" field.

insensitiveAnyOf

when T is Text, case-insensitive equality; when T is List, unordered equality; otherwise defaults to anyOf behavior

~=, ieq, iEquals, insensitiveEquals, iAnyOf

T | Collection where T = type of field

{ "name": { "insensitiveAnyOf": ["DAISY" , "PENNY"] } } All dogs with names matching the string "daisy" or "penny" regardless of capitalization.

noneOf

strict inequality test

!=, not, none, neq, !eq

T | Collection where T = type of field

{ "owner": { "noneOf": ["Damon", "Jeff"] } } All dogs who have an owner that is NOT "Damon" or "Jeff".

like

string contains, only works on text fields

like

T | Collection where T = type of field

{ "name": { "like": "y" } } Any dog that has the character "y" in their name.

Quantitative filters

FilterDescriptionAliasTypeExample

lessThan

less than, exclusive

<, lt

T where T = type of field

{ "age": { "lessThan": "5" } } All dogs who are less than 5 years old.

lessThanOrEqual

less than, inclusive

<=, lte

T where T = type of field

{ "age": { "lessThanOrEqual": "5" } } All dogs who are strictly younger than 5 years old.

greaterThan

greater than, exclusive

>, gt

T where T = type of field

{ "age": { "greaterThan": "2" } } All dogs who are strictly older than 2 years.

greaterThanOrEqual

greater than, inclusive

>=, gte

T where T = type of field

{ "age": { "greaterThanOrEqual": "10" } } All dogs who are at least 10 years old or older.

List/set filters

FilterDescriptionAliasTypeExample

intersects

matches where any of the elements in the filter also exist in the list

โˆฉ, intersect, intersection, intersectionOf

Set where T = type of element type in List * field type must be List

{ "nicknames": { "intersects": [ "dog", "doggy", "Lulu", "doesnโ€™t matter" ] } } Any entry that has a nickname in the searched array. In our example, it returns entries 2,3,6 & 7.

supersetOf

matches where the field is a superset of any of the provided sets

โŠ‡, superset, overlap, overlaps, overlapsAny, supersetOfAny

Set

Set<Set> where T = type of element type in List * field type must be List

subsetOf

matches where the field is a subset of any of the provided sets

โŠ†, subset, overlapped, subsetOfAny, overlappedBy

Set

Set<Set> where T = type of element type in List * field type must be List

containsAnyOf

if field is list, matches if any element in this set exists in the field if text, matches if any of the strings are a substring of the field

โˆˆ, containsAny

Set

Text where T = type of element type in List * field type must be List

containsAllOf

if field is list, matches if all elements in this set exist in the field if text, matches if all of the strings are a substring of the field

containsAll

Set

Text where T = type of element type in List * field type must be List

containsNoneOf

if field is list, matches if none of the elements in this set exist in the field if text, matches if none of the strings are a substring of the field

โˆ‰, containsNone

Set

Text where T = type of element type in List * field type must be List

Sorting data

In order to sort data from Airdata, add a Transform Data Operation downstream of the AirData Request and use a Query Expression to reorder the returned data.

Examples

You can use Airscript to further refine your AirData queries. For example:

{ "dogName": { "anyOf": "{{ LOWERCASE("LUCY")}}" } }

You can combine multiple queries to specify your search.

{ "dogName": { "insensitiveAnyOf": "daisy" }, "dogAge": { "greaterThan": 4 } }

๐Ÿ“˜ Note: Comma delimited queries function as an AND operation, not OR.

Last updated