Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Redis Pfadd Command

Redis Pfadd Command

Redis HyperLogLog

The Redis Pfadd command adds all element arguments to the HyperLogLog data structure.

Syntax

The basic syntax of the redis Pfadd command is as follows:



redis 127.0.0.1:6379> PFADD key element [element ...]

Available Version

= 2.8.9

Return Value

Integer reply: returns 1 if at least one element was added, otherwise returns 0.

Example



redis 127.0.0.1:6379> PFADD mykey a b c d e f g h i j

(integer) 1

redis 127.0.0.1:6379> PFCOUNT mykey

(integer) 10

Redis HyperLogLog