Skip to content

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

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

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

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.

desc("score") // through a schema: score:dec DESC
desc("score", "u256") // without one: score:u256 DESC

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

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

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

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.

desc("score") // through a schema: score:dec DESC
desc("score", "u256") // without one: score:u256 DESC