Redis HyperLogLog: PFCOUNT
PFCOUNT key [key ...]
Redis PFCOUNT command is used to get the approximated cardinality computed by the HyperLogLog data structure stored in the specified variable. If the key does not exist, then it returns 0.
Syntax:
PFCOUNT KEY1 [email protected] KEYN
Available since
2.8.9.
Return Value
Integer reply approximated a number of unique elements.
When PFCOUNT command is used with multiple keys, then it returns approximated cardinality of the union of the HyperLogLogs.
Return Value Type
Integer
Example: Redis PFCOUNT
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 127.0.0.1:6379> PFCOUNT mykey (integer) 10 redis 127.0.0.1:6379> PFCOUNT mykey mynewkey (integer) 10
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework