VCARD

Since 1.1.0Vector sets

Syntax

VCARD key
  • Flags: readonly
  • ACL categories: @read, @slow, @vector
  • Arity: -2

Returns the number of elements in the vector set at key. A key that does not exist counts as an empty set, so the answer is 0; removing the last element with VREM deletes the key.

VINFO gives the count too, with the set's dimension; VDIM gives the dimension alone.

Reply

  • The number of elements, as an integer.
  • WRONGTYPE if the key holds another type.

Examples

> VADD points VALUES 3 1 0 0 a
(integer) 1
> VADD points VALUES 3 0.9 0.1 0 b
(integer) 1
> VCARD points
(integer) 2
> VCARD missing
(integer) 0