new Predications(field)
Parameters:
| Name | Type | Description |
|---|---|---|
field |
string | The field name to set criteria against |
- Source:
Example
import { where, field } from '@pikselpalette/sequoia-js-client-sdk/lib/query';
where(field('title').notEqualTo('foo')).and(field("startedAt").lessThan("2014"))
Methods
-
between(start, end)
-
Generates a url encoded criteria expression equivalent to:
field=start/endParameters:
Name Type Description startstring | number start value for this predicate
endstring | number end value for this predicate
- Source:
Returns:
- Type
- string
Example
field('startedAt').between('2014', '2015'); // returns 'startedAt=2014/2015' -
equalTo(value)
-
Generates a url encoded criteria expression equivalent to:
field=valueParameters:
Name Type Description valuestring value for this predicate
- Source:
Returns:
- Type
- string
Example
field('engine').equalTo('diesel'); // returns 'engine=diesel' -
exists()
-
Generates a url encoded criteria expression equivalent to:
field=*- Source:
Returns:
- Type
- string
Example
field('engine').exists(); // returns 'engine=*' -
greaterThan(value)
-
Generates a url encoded criteria expression equivalent to:
field=!/valueParameters:
Name Type Description valuestring | number value for this predicate
- Source:
Returns:
- Type
- string
Example
field('startedAt').greaterThan(2015); // returns 'startedAt=!/2015' -
greaterThanOrEqualTo(value)
-
Generates a url encoded criteria expression equivalent to:
field=value/Parameters:
Name Type Description valuestring | number value for this predicate
- Source:
Returns:
- Type
- string
Example
field('startedAt').greaterThanOrEqualTo(2015); // returns 'startedAt=2015/' -
lessThan(value)
-
Generates a url encoded criteria expression equivalent to:
field=!value/Parameters:
Name Type Description valuestring | number value for this predicate
- Source:
Returns:
- Type
- string
Example
field('startedAt').lessThan(2015); // returns 'engine=!2015/' -
lessThanOrEqualTo(value)
-
Generates a url encoded criteria expression equivalent to:
field=/valueParameters:
Name Type Description valuestring | number value for this predicate
- Source:
Returns:
- Type
- string
Example
field('startedAt').lessThanOrEqualTo(2015); // returns 'startedAt=/2015' -
notBetween(start, end)
-
Generates a url encoded criteria expression equivalent to:
field=!start/endParameters:
Name Type Description startstring | number start value for this predicate
endstring | number end value for this predicate
- Source:
Returns:
- Type
- string
Example
field('startedAt').notBetween('2014', '2015'); // returns 'startedAt=!2014/2015' -
notEqualTo(value)
-
Generates a url encoded criteria expression equivalent to:
field=!valueParameters:
Name Type Description valuestring value for this predicate
- Source:
Returns:
- Type
- string
Example
field('engine').notEqualTo('diesel'); // returns 'engine=!diesel' -
notExists()
-
Generates a url encoded criteria expression equivalent to:
field=!*- Source:
Returns:
- Type
- string
Example
field('engine').notExists(); // returns 'engine=!*' -
oneOrMoreOf(value)
-
Generates a url encoded criteria expression equivalent to:
field=value1||value2Parameters:
Name Type Argument Description valuestring <repeatable>
value(s) for this predicate
- Source:
Returns:
- Type
- string
Example
field('engine').oneOrMoreOf('diesel', 'petrol'); // returns 'engine=diesel||petrol' -
startsWith(value)
-
Generates a url encoded criteria expression equivalent to:
field=value*Parameters:
Name Type Description valuestring value for this predicate
- Source:
Returns:
- Type
- string
Example
field('engine').startsWith('diesel'); // returns 'engine=diesel*'
Javascript Client SDK