kevy

HRANDFIELD

Return random fields from a hash; a negative count allows repeats, WITHVALUES pairs each with its value.

SyntaxHRANDFIELD key [count [WITHVALUES]]
Grouphash
Arity-2
Since6.2.0
Flagsreadonly
ComplexityO(count) for the positive form (partial Fisher-Yates over a materialised field list), O(|count|) for the negative form
Redis compatibilityfull

← All commands