between
between<
N,L,H>(name,low,high):BetweenNode<ValueRef<N,L>>
Defined in: src/query/expression.ts:375
Attribute lies between two values, inclusive at both ends: it matches exactly what
and(gte(name, low), lte(name, high)) matches, in one predicate. Both bounds must have one type,
and a low above high matches nothing.
Type Parameters
Section titled “Type Parameters”N extends string
L extends PredicateValue
H extends PredicateValue
Parameters
Section titled “Parameters”N
L
H & SameTypeCheck<L, H>
Returns
Section titled “Returns”BetweenNode<ValueRef<N, L>>
Throws
Section titled “Throws”If the name is outside the attribute name grammar.
Throws
Section titled “Throws”If the bounds have different types, the name starts with $ but
is not a queryable system attribute, a system attribute is compared against the wrong type, or a
bound is bytes.
Example
Section titled “Example”between("score", dec("3.5"), dec("5")) // score BETWEEN dec(3.5) AND dec(5)between("$expiresAt", u64(100n), u64(200n))