MongrelDB::QueryBuilder
QueryBuilder builds a request for the daemon's /kit/query endpoint,
where conditions push down to the engine's specialized indexes.
Condition parameters accept friendly aliases that are translated to the
server's exact on-wire keys before sending (see #where).
Example:
rows = db.query("orders")
.where("bitmap_eq", {"column" => 2, "value" => "electronics"})
.where("range_f64", {"column" => 3, "min" => 100.0})
.projection([1, 2, 3])
.limit(50)
.execute
if db.query("orders").truncated
# result set hit the limit; more matches exist on the server
end
Constructors
Class methods
Instance methods
execute
Run the query and return the matching rows. Also records whether the
result was truncated by the limit; check it with #truncated.
Set the column projection (column ids to return). nil means all columns.
truncated?
Whether the most recent #execute result was capped by the limit.
Returns false until #execute has been called.