Skip to content

asc<N>(name): OrderTerm<OrderRef<N, never>>

Defined in: src/query/order.ts:119

Sorts by an attribute, smallest first, in the order values compare in — see ComparisonOperator. Entities where the attribute is unset, or set with another type, come first.

N extends string

N

An attribute of any type but bytes, indexed or not, or one of the system attributes $key, $owner, $creator and $expiresAt.

OrderTerm<OrderRef<N, never>>

If the name is outside the attribute name grammar.

If the name starts with $ but is not a queryable system attribute, the type is bytes or not a type, or a system attribute is given another type.

asc("title") // through a schema: title:str ASC
asc("score", "u256") // without one: score:u256 ASC
asc("$expiresAt") // $expiresAt:u64 ASC

asc<N, T>(name, type): OrderTerm<OrderRef<N, T>>

Defined in: src/query/order.ts:120

Sorts by an attribute, smallest first, in the order values compare in — see ComparisonOperator. Entities where the attribute is unset, or set with another type, come first.

N extends string

T extends IndexableTypeTag

N

An attribute of any type but bytes, indexed or not, or one of the system attributes $key, $owner, $creator and $expiresAt.

T

The type to sort the attribute as. A system attribute’s is fixed, and through a schema it is the column’s, so it is needed only for a query without one.

OrderTerm<OrderRef<N, T>>

If the name is outside the attribute name grammar.

If the name starts with $ but is not a queryable system attribute, the type is bytes or not a type, or a system attribute is given another type.

asc("title") // through a schema: title:str ASC
asc("score", "u256") // without one: score:u256 ASC
asc("$expiresAt") // $expiresAt:u64 ASC