One of the main features of the collection resources in everest are their advanced querying capabilities. Query strings have to conform to
An incoming query through a GET request is processed by everest in two steps: First, the query string submitted by the client is parsed into a query specification; and second, this query specification is translated to an object that can be applied to the collection resource acting as the query context.
As an example, querying a collection resource “”
If a query contains multiple criteria with different resource attribute names, the criteria are interpreted as a Boolean “AND” operation.
The following table shows the available operators and data types in CQL:
Operator | Data Type | ||||
---|---|---|---|---|---|
Name | String | Number | Boolean | Date/Time | Resource |
starts-with | x | ||||
not-starts-with | x | ||||
ends-with | x | ||||
not-ends-with | x | ||||
contains | x | ||||
not-contains | x | ||||
contained | x | ||||
not-contained | x | ||||
equal-to | |||||
not-equal-to | |||||
less-than | |||||
less-than-or-equal-to | |||||
greater-than | |||||
greater-than-or-equal-to | |||||
in-range |
All attributes that are used to compose a query expression need to be mapped column properties in the ORM. Aliases are supported, CompositeProperties are not. All queried entities must have an “id” attribute.
It is by design that the power of CQL to express complex queries is far behind that of SQL.