Query

class Query

A predicate, what to return for each match, and how much of the store to look at.

Immutable, and every builder returns a new one, so a query is safe to keep and to reuse across snapshots. Rows come back in key order; there is no ordering by value, because a shredded column is ordered only within a segment and a value order across segments would need either full materialisation or a per-value merge — neither of which this phase claims.

val query = Query.where(path("$.team") eq "analytics" and (path("$.score") ge 10))
.project(Projection.of("$.team", "$.score"))
.limit(100)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val from: Key?

Inclusive lower key bound, pushed into both the index and the scan.

Link copied to clipboard
val limit: Int

Rows to return at most, or NO_LIMIT.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val to: Key?

Inclusive upper key bound.

Functions

Link copied to clipboard
fun limit(rows: Int): Query

The same query returning at most rows.

Link copied to clipboard
fun project(projection: Projection): Query

The same query returning projection.

fun project(vararg expressions: String): Query

The same query returning the fields named by expressions. See Projection.of.

Link copied to clipboard
fun range(from: Key?, to: Key?): Query

The same query restricted to keys in [from, to], both bounds inclusive and both optional.

Link copied to clipboard
open override fun toString(): String