Skip to content
Database dbCount

$dbCount

$dbCount counts without loading the documents.

Syntax

$dbCount[collection;(field);(operator);(value)]

Parameters

Parameter Description
collection Collection name: lowercase letters, digits, _, . or - (up to 64 characters). It is created on first write.
field Optional. Field to test.
operator Optional. = (default), !=, <, <=, >, >= or prefix.
value Value to compare, read like in $dbFind.

Return value

  • The number of documents.

Examples

$dbCount[players]
$dbCount[players;xp;>=;100]

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.