Interface: Condition

query.Condition

The Condition interface defines all existing query filters

Source:

Members

in

Adds an “in” filter to the field

The field value must be equal to one of the given values.

Source:
See:

Methods

addFilter(field, filter, value) → {query.Filter.<T>}

Adds a filter to this query

Parameters:
Name Type Description
field string
filter string
value *
Source:
Returns:

The resulting Query

Type
query.Filter.<T>

between(field, greaterValue, lessValue) → {query.Filter.<T>}

Adds a between filter to the field. This is a shorthand for an less than and greater than filter.

Parameters:
Name Type Description
field string

The field to filter

greaterValue number | string | Date | binding.Entity

The field value must be greater than this value

lessValue number | string | Date | binding.Entity

The field value must be less than this value

Source:
Returns:

The resulting Query

Type
query.Filter.<T>

containsAll(field, …args) → {query.Filter.<T>}

Adds a contains all filter to the collection field

The collection must contain all the given values.

Parameters:
Name Type Attributes Description
field string

The field to filter

args * | Array.<*> <repeatable>

The field value or values to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

containsAny(field, …args) → {query.Filter.<T>}

The collection must contains one of the given values

Adds a contains any filter to the collection field.
Alias for query.Condition#in.

Parameters:
Name Type Attributes Description
field string

The field to filter

args * | Array.<*> <repeatable>

The field value or values to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

eq(field, value) → {query.Filter.<T>}

Adds a equal filter to the field

All other other filters on the field will be discarded.

Parameters:
Name Type Description
field string

The field to filter

value *

The value used to filter

Source:
Returns:

The resulting Query

Type
query.Filter.<T>

equal(field, value) → {query.Filter.<T>}

Adds a equal filter to the field. All other other filters on the field will be discarded

Parameters:
Name Type Description
field string

The field to filter

value *

The value used to filter

Source:
Returns:

The resulting Query

Type
query.Filter.<T>

ge(field, value) → {query.Filter.<T>}

Adds a greater than or equal to filter to the field

Shorthand for query.Condition#greaterThanOrEqualTo.

Parameters:
Name Type Description
field string

The field to filter

value number | string | Date | binding.Entity

The value used to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

greaterThan(field, value) → {query.Filter.<T>}

Adds a greater than filter to the field

Parameters:
Name Type Description
field string

The field to filter

value number | string | Date | binding.Entity

The value used to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

greaterThanOrEqualTo(field, value) → {query.Filter.<T>}

Adds a greater than or equal to filter to the field

Parameters:
Name Type Description
field string

The field to filter

value number | string | Date | binding.Entity

The value used to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

gt(field, value) → {query.Filter.<T>}

Adds a greater than filter to the field

Shorthand for query.Condition#greaterThan.

Parameters:
Name Type Description
field string

The field to filter

value number | string | Date | binding.Entity

The value used to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

in(field, …args) → {query.Filter.<T>}

Adds a “in” filter to the field

The field value must be equal to one of the given values.

Parameters:
Name Type Attributes Description
field string

The field to filter

args * | Array.<*> <repeatable>

The field value or values to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

isNotNull(field) → {query.Filter.<T>}

Adds a “is not null” filter to the field

The field value must not be null.

Parameters:
Name Type Description
field string

The field to filter

Source:
Returns:

The resulting Query

Type
query.Filter.<T>

isNull(field) → {query.Filter.<T>}

Adds a “is null” filter to the field

The field value must be null.

Parameters:
Name Type Description
field string

The field to filter

Source:
Returns:

The resulting Query

Type
query.Filter.<T>

le(field, value) → {query.Filter.<T>}

Adds a less than or equal to filter to the field

Shorthand for query.Condition#lessThanOrEqualTo.

Parameters:
Name Type Description
field string

The field to filter

value number | string | Date | binding.Entity

The value used to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

lessThan(field, value) → {query.Filter.<T>}

Adds a less than filter to the field

Parameters:
Name Type Description
field string

The field to filter

value number | string | Date | binding.Entity

The value used to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

lessThanOrEqualTo(field, value) → {query.Filter.<T>}

Adds a less than or equal to filter to the field

Parameters:
Name Type Description
field string

The field to filter

value number | string | Date | binding.Entity

The value used to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

lt(field, value) → {query.Filter.<T>}

Adds a less than filter to the field

Shorthand for query.Condition#lessThan.

Parameters:
Name Type Description
field string

The field to filter

value number | string | Date | binding.Entity

The value used to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

matches(field, regExp) → {query.Filter.<T>}

Adds a regular expression filter to the field

The field value must matches the regular expression.

Note: Only anchored expressions (Expressions that starts with an ^) and the multiline flag are supported.

Parameters:
Name Type Description
field string

The field to filter

regExp string | RegExp

The regular expression of the filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

mod(field, divisor, remainder) → {query.Filter.<T>}

Adds a modulo filter to the field

The field value divided by divisor must be equal to the remainder.

Parameters:
Name Type Description
field string

The field to filter

divisor number

The divisor of the modulo filter

remainder number

The remainder of the modulo filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

ne(field, value) → {query.Filter.<T>}

Adds a not equal filter to the field

Parameters:
Name Type Description
field string

The field to filter

value *

The value used to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

near(field, geoPoint, maxDistance) → {query.Filter.<T>}

Adds a geopoint based near filter to the GeoPoint field

The GeoPoint must be within the maximum distance
to the given GeoPoint. Returns from nearest to farthest.

Parameters:
Name Type Description
field string

The field to filter

geoPoint GeoPoint

The GeoPoint to filter

maxDistance number

Tha maximum distance to filter in meters

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

notEqual(field, value) → {query.Filter.<T>}

Adds a not equal filter to the field

Parameters:
Name Type Description
field string

The field to filter

value *

The value used to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

notIn(field, …args) → {query.Filter.<T>}

Adds a “not in” filter to the field

The field value must not be equal to any of the given values.

Parameters:
Name Type Attributes Description
field string

The field to filter

args * | Array.<*> <repeatable>

The field value or values to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

size(field, size) → {query.Filter.<T>}

Adds a size filter to the collection field

The collection must have exactly size members.

Parameters:
Name Type Description
field string

The field to filter

size number

The collections size to filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>

where(conditions) → {query.Filter.<T>}

An object that contains filter rules which will be merged with the current filters of this query

Parameters:
Name Type Description
conditions json

Additional filters for this query

Source:
Returns:

The resulting Query

Type
query.Filter.<T>

withinPolygon(field, …geoPoints) → {query.Filter.<T>}

Adds a GeoPoint based polygon filter to the GeoPoint field

The GeoPoint must be contained within the given polygon.

Parameters:
Name Type Attributes Description
field string

The field to filter

geoPoints GeoPoint | Array.<GeoPoint> <repeatable>

The geoPoints that describes the polygon of the filter

Source:
See:
Returns:

The resulting Query

Type
query.Filter.<T>