VRANDMEMBER

Since 1.1.0Vector sets

Syntax

VRANDMEMBER key [count]
  • Flags: readonly
  • ACL categories: @read, @slow, @vector
  • Arity: -2

Returns elements of the vector set at key, picked at random: one, or count different ones, or, with a negative count, exactly -count that may repeat.

Examples

> VRANDMEMBER points 2
1) "c"
2) "a"