ClauseBuilder

DSL for the conditions inside a filter clause. Offers both function-style (match("city", "London"), range("price", gte = 100.0)) and infix-style ("city" eq "London", "price" between 100.0..450.0) entry points.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Inclusive numeric range, e.g. "price" between 100.0..450.0.

Link copied to clipboard
fun datetimeRange(key: String, gt: String? = null, gte: String? = null, lt: String? = null, lte: String? = null)

RFC 3339 datetime range condition; provide any subset of bounds.

Link copied to clipboard
infix fun String.eq(value: Any)

Infix form of match.

Link copied to clipboard
fun filter(configure: FilterBuilder.() -> Unit)

A nested boolean sub-filter as a single condition (for grouping / de Morgan expressions).

Link copied to clipboard
fun geoBoundingBox(key: String, topLeft: GeoPoint, bottomRight: GeoPoint)

Points within the given bounding box.

Link copied to clipboard
fun geoPolygon(key: String, exterior: List<GeoPoint>, interiors: List<List<GeoPoint>> = emptyList())

Points inside exterior and outside every ring in interiors.

Link copied to clipboard
fun geoRadius(key: String, center: GeoPoint, radius: Double)

Points within radius metres of center.

Link copied to clipboard
infix fun String.gt(value: Number)
Link copied to clipboard
infix fun String.gte(value: Number)
Link copied to clipboard
fun hasId(ids: List<PointId>)
fun hasId(vararg ids: PointId)

Point id is one of ids.

Link copied to clipboard
fun hasVector(name: String)

The named vector is present ("" for the anonymous vector).

Link copied to clipboard
fun isEmpty(key: String)

Field missing, null, or an empty array.

Link copied to clipboard
fun isNull(key: String)

Field present but null.

Link copied to clipboard
infix fun String.lt(value: Number)
Link copied to clipboard
infix fun String.lte(value: Number)
Link copied to clipboard
fun match(key: String, value: Any)

Exact value match. value must be a String, Number or Boolean.

Link copied to clipboard
fun matchAny(key: String, values: Collection<Any>)

Value-in-set (any). Each value must be a String, Number or Boolean.

fun matchAny(key: String, vararg values: Any)

Value-in-set (any).

Link copied to clipboard
fun matchExcept(key: String, values: Collection<Any>)
fun matchExcept(key: String, vararg values: Any)

Value-not-in-set (except).

Link copied to clipboard
fun matchPhrase(key: String, text: String)

Exact phrase match (order matters).

Link copied to clipboard
fun matchText(key: String, text: String)

Full-text match: all tokens present.

Link copied to clipboard
fun matchTextAny(key: String, text: String)

Full-text match: at least one token present.

Link copied to clipboard
fun nested(key: String, configure: FilterBuilder.() -> Unit)

Sub-filter evaluated per element of the array field key.

Link copied to clipboard
fun range(key: String, gt: Number? = null, gte: Number? = null, lt: Number? = null, lte: Number? = null)

Numeric range condition; provide any subset of bounds.

Link copied to clipboard
fun valuesCount(key: String, gt: Int? = null, gte: Int? = null, lt: Int? = null, lte: Int? = null)

Condition on the number of values in an array field.