Olinda - Data Service Platform

Operators - $Filter

OData protocol supports a set of filter operations. The following table lists the available operators of the protocol until now.
Operator Description Exemple
Comparison Operators
eq Equal City eq 'Redmond'
ne Not equal City ne 'London'
gt Greater than Price gt 20
ge Greater than or equal Price ge 10
lt Less than Price lt 20
le Less than or equal Price le 100
Logiacal Operators
and Logical and Price le 200 and Price gt 3.5
or Logical or Price le 3.5 or Price gt 200
not Logical negation not endswith(Description,'milk')
Arithmetic Operators
add Addition Price add 5 gt 10
sub Subtraction Price sub 5 gt 10
mul Multiplication Price mul 2 gt 2000
div Division Price div 2 gt 4
mod Modulo Price mod 2 eq 0
Grouping Operators
( ) Precedence grouping (Price sub 5) gt 10

Funções de consulta - $Filter

OData supports a set of built-in functions that can be used within $filter operations. The following table lists the available functions of the protocol until now.
OData does not define an ISNULL or COALESCE operator. Instead, there is a null literal that can be used in comparisons.
Function Exemple
String Functions
contains contains(CompanyName,'freds')
endswith endswith(CompanyName,'Futterkiste')
startswith startswith(CompanyName,'Alfr')
length length(CompanyName) eq 19
substring substring(CompanyName,1) eq 'lfreds Futterkiste'
tolower tolower(CompanyName) eq 'alfreds futterkiste'
toupper toupper(CompanyName) eq 'ALFREDS FUTTERKISTE'
trim trim(CompanyName) eq 'Alfreds Futterkiste'
concat concat(concat(City,', '), Country) eq 'Berlin, Germany'

Attention: when setting the filter, make sure to not use extra spaces and that the operators and functions are in lower case.