w3resource

Redis HyperLogLog: PFMERGE

PFMERGE destkey sourcekey [sourcekey ...]

Redis PFMERGE command is used to merge multiple HyperLogLog values into a unique value that will approximate the cardinality of the union of the observed Sets of the source HyperLogLog structures.

Syntax:

PFMERGE KEY1 KEY@... KEYN

Available since

2.8.9.

Return Value

Simple string reply OK

Return Value Type

String

Example: Redis PFMERGE

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

Previous: PFCOUNT
Next: Redis PubSub PSUBSCRIBE



Follow us on Facebook and Twitter for latest update.