Skip to main content

Description

Returns the number of keys that exist from those specified as arguments.

Method Signature

Parameters

keys
string[]
required
One or more keys to check for existence

Return Value

result
number
The number of keys that exist. If the same existing key is mentioned in the arguments multiple times, it will be counted multiple times.

Examples

Check single key existence

Check multiple keys

Duplicate keys are counted multiple times

See Also

  • del - Delete keys
  • keys - Find keys matching a pattern