Redis Hyperloglog command

PFMERGE

PFMERGE destkey sourcekey [sourcekey ...]

#Example

redis> PFADD hll1 foo bar zap a
(integer) 1
redis> PFADD hll2 a b c foo
(integer) 1
redis> PFMERGE hll3 hll1 hll2
"OK"
redis> PFCOUNT hll3
(integer) 6

Merge N different HyperLogLogs into a single one.

PFCOUNT

PFCOUNT key [key ...]

#Example

redis> PFADD hll foo bar zap
(integer) 1
redis> PFADD hll zap zap zap
(integer) 0
redis> PFADD hll foo bar
(integer) 0
redis> PFCOUNT hll
(integer) 3
redis> PFADD some-other-hll 1 2 3
(integer) 1
redis> PFCOUNT hll some-other-hll
(integer) 6

Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).

PFADD

PFADD key element [element ...]

#Example

redis> PFADD hll a b c d e f g
(integer) 1
redis> PFCOUNT hll
(integer) 7

Adds the specified elements to the specified HyperLogLog.

Comments