API endpoints that allow you to list typically provide two ways of filtering the results.

Query

You can use the query parameter to filter the results by a search term. The search term is matched against the name of the resource. For example, to list all the projects that contain the word “test” in their name, you can use the following query:
GET /api/projects?query=test

Filter

Filters allow for a more fine-grained filtering of the results. You can use the filter parameter to filter the results by a specific field. For example, to list all the projects that have the name “test”, you can use the following filter:
GET /api/projects?filter="name: 'test'"

Fields

Field names should be directly given without any extra literals. Dots indicate nested fields. For example: category.updatedAt

Inputs

Numbers should be directly given. Booleans should also directly be given, valid values are true and false. Others such as strings, enums, dates, should be quoted. For example: status : 'active'

Operators

LiteralDescriptionExample
andand’s two expressionsstatus : ‘active’ and createdAt > ‘1-1-2000’
oror’s two expressionsvalue ~ ‘%hello%’ or name ~ ‘%world%‘
notnot’s an expressionnot (id > 100 or category.order is null)
You may prioritize operators using parentheses, for example: x and (y or z)

Comparators

LiteralDescriptionExample
~checks if the left (string) expression is similar to the right (string) expressioncatalog.name ~electronic
~~similar to the previous operator but case insensitivecatalog.name ~~ ‘ElEcTroNic*‘
:checks if the left expression is equal to the right expressionid : 5
!checks if the left expression is not equal to the right expressionusername ! ‘torshid’
>checks if the left expression is greater than the right expressiondistance > 100
>:checks if the left expression is greater or equal to the right expressiondistance >: 100
<checks if the left expression is smaller than the right expressiondistance < 100
<:checks if the left expression is smaller or equal to the right expressiondistance <: 100
isNullchecks if an expression is nullstatus isNull
isNotNullchecks if an expression is not nullstatus isNotNull
is emptychecks if the (collection) expression is emptychildren is empty
is not emptychecks if the (collection) expression is not emptychildren is not empty
inchecks if an expression is present in the right expressionsstatus in [‘initialized’, ‘active’]
not inchecks if an expression is not present in the right expressionsstatus not in [‘failed’, ‘closed’]
Note that the * character can also be used instead of % when using the ~ comparator. By default, this comparator is case insensitive, the behavior can be changed with FilterParameters.CASE_SENSITIVE_LIKE_OPERATOR.

Functions

A function is characterized by its name (case insensitive) followed by parentheses. For example: currentTime(). Some functions might also take arguments, arguments are separated with commas. For example: min(ratings) > 3
NameDescriptionExample
absolutereturns the absoluteabsolute(x)
averagereturns the averageaverage(ratings)
minreturns the minimummin(ratings)
maxreturns the maximummax(ratings)
sumreturns the sumsum(a, b), sum(scores)
diffreturns the differencediff(a, b)
prodreturns the productprod(a, b)
quotreturns the quotientquot(a, b)
modreturns the modulusmod(a, b)
sqrtreturns the square rootsqrt(a)
currentDatereturns the current datecurrentDate()
currentTimereturns the current timecurrentTime()
currentTimestampreturns the current timestampcurrentTimestamp()
sizereturns the collection’s sizesize(accidents)
lengthreturns the string’s lengthlength(name)
trimreturns the trimmed stringtrim(name)
upperreturns the uppercased stringupper(name)
lowerreturns the lowercased stringlower(name)
concatreturns the concatenation of given stringsconcat(firstName, ’ ’, lastName)

Subqueries

NameDescriptionExampleExplanation
existsreturns the existence of a subquery resultexists(employees.age > 60)returns true if at least one employee’s age is greater than 60