Skip to content

Commit 96a0f0c

Browse files
committed
HyperLogLogs - pfCount
1 parent 75a6f3f commit 96a0f0c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.markdown

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3138,6 +3138,28 @@ $redis->pfAdd('hll', ['a', 'b', 'c']);
31383138
### pfCount
31393139
-----
31403140

3141+
##### *Prototype*
3142+
~~~php
3143+
$redis->pfCount($key);
3144+
$redis->pfCount(Array $keys);
3145+
~~~
3146+
3147+
_**Description**_: Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
3148+
3149+
##### *Return value*
3150+
*Integer*: The approximated number of unique elements observed via [pfAdd](#pfAdd).
3151+
3152+
##### *Example*
3153+
~~~php
3154+
$redis->pfAdd('hll1', ['a', 'b', 'c']); // (int) 1
3155+
$redis->pfCount('hll1'); // (int) 3
3156+
3157+
$redis->pfAdd('hll2', ['d', 'e', 'a']); // (int) 1
3158+
$redis->pfCount('hll2'); // (int) 3
3159+
3160+
$redis->pfCount(['hll1', 'hll2']); // (int) 5
3161+
~~~
3162+
31413163
### pfMerge
31423164
-----
31433165

0 commit comments

Comments
 (0)