Returning Values
Sort
Sorts the results by the specified keys.
.sort(keys)
Once - This can only be used once.
Accepts a single key or an array of keys.
Sorts the results by the specified keys.
Prefixes:
-: Descending order.+: DEFAULT. Ascending order.
Macros:
@random: Orders by sqlite's random() function. Useful for shuffling results.@rowid: NOT THE SAME ASid. Orders by sqlite's internalrowid. Can't be used with View Collections.
const query = pbQuery<Post>()
.sort(['title', '-created'])
.build(pb.filter);
console.log(query.sort) // Output: 'title,-created'