Upstash Documentation

$count

1 min read

$count returns how many documents contribute a value for a field.

How It Works#

  • By default, only documents that have the field are counted.
  • If missing is set, documents without the field also contribute to result.

Compatibility#

Field TypeSupported
TEXTNo
U64/I64/F64Yes
DATEYes
BOOLYes
KEYWORDYes
FACETNo

Field must be FAST.

Arguments#

ArgumentTypeRequiredDescription
fieldstringYesField to count values for.
missingnumberNoFallback value for missing fields.

Output#