Namespace: functions

ODataFilterBuilder.functions

Canonical Functions
Source:

Methods

(static) concat(field, value, normaliseValueopt) → {string}

Parameters:
Name Type Attributes Default Description
field ODataFilterBuilder~InputField The first function parameter
value string The second function parameter
normaliseValue boolean <optional>
true Convert string "value" to "'value'" or not. (Convert by default)
Source:
Returns:
A function string
Type
string
Example
f().eq(x => x.concat(y => y.concat('City',', '), 'Country', false), 'Berlin, Germany');
// concat(concat(City, ', '), 'Country') eq 'Berlin, Germany'

(static) indexOf(field, value) → {string}

The indexof function returns the zero-based character position of the first occurrence of the second parameter value in the first parameter value.
Parameters:
Name Type Description
field ODataFilterBuilder~InputField The first function parameter
value string The second function parameter
Source:
Returns:
A function string
Type
string
Example
f().eq(f.functions.indexOf('CompanyName', 'lfreds'), 1)
f().eq(x => x.indexOf('CompanyName', 'lfreds'), 1)
// indexof(CompanyName,'lfreds') eq 1

(static) length(field) → {string}

The length function returns the number of characters in the parameter value.
Parameters:
Name Type Description
field ODataFilterBuilder~InputField Field
Source:
Returns:
A function string
Type
string
Example
f().eq(x => x.length('CompanyName'), 19)
// length(CompanyName) eq 19

(static) substring(field, …values) → {string}

Parameters:
Name Type Attributes Description
field ODataFilterBuilder~InputField The first function parameter
values number <repeatable>
Second or second and third function parameters
Source:
Returns:
A function string
Type
string
Examples
f().eq(f.functions.substring('CompanyName', 1), 'lfreds Futterkiste');
f().eq(x => x.substring('CompanyName', 1), 'lfreds Futterkiste');
// substring(CompanyName, 1) eq 'lfreds Futterkiste'
f().eq(x => x.substring('CompanyName', 1, 2), 'lf').toString();
f().eq(f.functions.substring('CompanyName', 1, 2), 'lf')
// substring(CompanyName, 1, 2) eq 'lf'

(static) toLower(field) → {string}

The tolower function returns the input parameter string value with all uppercase characters converted to lowercase.
Parameters:
Name Type Description
field ODataFilterBuilder~InputField Field
Source:
Returns:
A function string
Type
string
Example
f().eq(x => x.toLower('CompanyName'), 'alfreds futterkiste')
// tolower(CompanyName) eq 'alfreds futterkiste'

(static) toUpper(field) → {string}

The toupper function returns the input parameter string value with all lowercase characters converted to uppercase.
Parameters:
Name Type Description
field ODataFilterBuilder~InputField Field
Source:
Returns:
A function string
Type
string
Example
f().eq(x => x.toUpper('CompanyName'), 'ALFREDS FUTTERKISTE')
// toupper(CompanyName) eq 'ALFREDS FUTTERKISTE'

(static) trim(field) → {string}

The trim function returns the input parameter string value with all leading and trailing whitespace characters, removed.
Parameters:
Name Type Description
field ODataFilterBuilder~InputField Field
Source:
Returns:
A function string
Type
string
Example
f().eq(x => x.trim('CompanyName'), 'CompanyName')
// trim(CompanyName) eq CompanyName