$dbTop

$dbTop is the leaderboard query. On a large collection, index the field first.

Syntax

$dbTop[collection;field;count;(order)]

Parameters

Parameter Description
collection Collection name: lowercase letters, digits, _, . or - (up to 64 characters). It is created on first write.
field Numeric field to rank on.
count How many documents (1 to 100).
order Optional. desc (default, highest first) or asc.

Return value

Examples

$dbTop[players;xp;10]