Table of Contents generated with DocToc
The AQL Query Language supports property-based queries with various operators and logical combinations. This parser is meant to work together with the
foam.parse.auto.SmartView component, providing suggestions to the user as they type and it is referred to as AQL.
Combine expressions with an explicit AND or &:
expression1 AND expression2
expression1 & expression2
Negate expressions with NOT:
NOT expression
Combine expressions with OR or pipe:
expression1 OR expression2
expression1 | expression2
Use parentheses for complex expressions:
(field1 = "value1" OR field2 > 123) AND field3 IS NOT EMPTY
Supported property values are:
[!IMPORTANT] In the JavaScript parser, only properties marked as
searchablein the model are available for querying. The Java parser accepts every property.
Supported expressions are property type dependant, not all operations pertain to all types.
The expressions that are supported for strings are:
| String Expression | Description |
|---|---|
| property CONTAINS value | property contains value |
| property : value | property contains value |
| property ~ value | property contains value |
| property = value | property exactly matches “value” |
| property IN (value1,value2,…) | property exactly matches any of the listed values |
| property NOT IN (value1,value2,…) | property does not exactly match any of the listed values |
| property > value | property is greater than value |
| property < value | property is less than value |
| property >= value | property is greater than or equal to value |
| property <= value | property is less than or equal to value |
| property != value | property is not equal to value |
| property IS EMPTY | property is is empty |
| property IS NOT EMPTY | property is not empty |
stringField = email@somedomain.com
stringField = "Quoted String"
stringField = "Quoted \\" String"
stringField = "Quoted , String"
stringField = SomeName
stringField != SomeName
stringField CONTAINS SomeName
stringField ~ SomeName
stringField IN (SomeName,AnotherName)
stringField IS EMPTY
The expressions that are supported for all numbers are:
| Number Expression | Description |
|---|---|
| property >= value | property is greater than or equal to value |
| property > value | property is greater than value |
| property <= value | property is less than or equal to value |
| property < value | property is less than value |
| property != value | property is not equal to value |
| property = value | property equals value |
Additional expressions that are supported for floating point numbers only:
| Float Expression | Description |
|---|---|
| property IN RANGE (min,max) | property is within the range from min to max inclusive |
| property NOT IN RANGE (min,max) | property is outside the range from min to max |
Additional expressions that are supported for integers only:
| Integer Expression | Description |
|---|---|
| property IN (value1,value2,…) | property equals any of the listed values |
| property NOT IN (value1,value2,…) | property does not equal any of the listed values |
intField = -6
intField != 6
intField IN (6,7,8)
floatField = 123.45
floatField IN RANGE (1.0,2.0)
floatField NOT IN RANGE (1.0,2.0)
The expressions that are supported for booleans are:
| Boolean Expression | Description |
|---|---|
| property IS TRUE | property equals true |
| property IS FALSE | property equals false |
boolField IS TRUE
boolField IS FALSE
The date values should always be in the ISO UTC format. The expressions that are supported for dates are:
| Date Expression | Description |
|---|---|
| property >= date | property is greater than or equal to date |
| property > date | property is greater than date |
| property <= date | property is less than or equal to date |
| property < date | property is less than date |
| property != date | property is not equal to date |
| property = date | property equals date |
| property IN RANGE (start,end) | property is within the range from start to end inclusive |
| property NOT IN RANGE (start,end) | property is outside the range from start to end |
| property IS EMPTY | property is empty |
| property IS NOT EMPTY | property is not empty |
dateField = 2025-10-21
dateField > 2025-10-21
dateField >= 2025-10-21
dateField < 2025-10-21
dateField <= 2025-10-21
dateField != 2025/10/21
dateField = 2025-10-21T14:30
dateField = TODAY
dateField = TODAY+7
dateField = TODAY-7
dateField IN RANGE (2025-10,2025-10)
dateField IN RANGE (2025,2025)
dateField IN RANGE (2025-10-21T14:30:45.123Z,2025-10-22T14:30:45.123Z)
dateField NOT IN RANGE (2025/10/21T14,2025/10/21T15)
dateField IS EMPTY
The expressions that are supported for enums are:
| Enum Expression | Description |
|---|---|
| property = EnumValue | property equals the enum value |
| property != EnumValue | property does not equal the enum value |
| property IN (EnumValue1,EnumValue2,…) | property equals any of the listed enum values |
| property NOT IN (EnumValue1,EnumValue2,…) | property does not equal any of the listed enum values |
The expressions support enums and their values. For example, if a lifecycleState property is an enum with values like ACTIVE and REJECTED, you can query:
lifecycleState = ACTIVE
lifecycleState != ACTIVE
lifecycleState IN (ACTIVE, REJECTED)
lifecycleState NOT IN (ACTIVE, REJECTED)
The expressions that are supported for StringArray properties are:
| StringArray Expression | Description |
|---|---|
| property = value | property has value as an element |
| property HAS value | property has value as an element |
| property != value | property does not have value as an element |
| property IN (value1,value2,…) | property has any of the listed values (alias of HAS ANY) |
| property NOT IN (value1,value2,…) | property has none of the listed values (alias of DOES NOT HAVE ANY) |
disabledTopics IN (topicName1,topicName2,topicName3)
disabledTopics NOT IN (topicName1,topicName2,topicName3)
disabledTopics = topicName
disabledTopics != topicName