Skip to content

Commit 30696a2

Browse files
Update hyperloglog.md
1 parent a0b12c0 commit 30696a2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ds/prob/hyperloglog.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ The `PFADD` command is used to create and add items to a HLL key. There are a fe
1717
- When a key name and one or more elements are passed, a new HLL will be created and the elements will be added to it.
1818
If the cardinality is changed as a result of the operation, `1` is returned; otherwise, `0` is returned.
1919

20-
```redis Create a new HLL set
20+
```redis:[run_confirmation=true] Create a new HLL set
2121
PFADD bikes // returns 1
2222
```
2323

24-
```redis Try to re-create bikes
24+
```redis:[run_confirmation=true] Try to re-create bikes
2525
PFADD bikes // returns 0
2626
```
2727

28-
```redis Add elements to bikes
28+
```redis:[run_confirmation=true] Add elements to bikes
2929
PFADD bikes Hyperion Deimos Phoebe Quaoar // returns 1
3030
```
3131

32-
```redis Try to duplicate an item already present on bikes
32+
```redis:[run_confirmation=true] Try to duplicate an item already present on bikes
3333
PFADD bikes Deimos // returns 0
3434
```
3535

@@ -41,7 +41,7 @@ PFCOUNT bikes
4141

4242
Now create another HLL called `commuter_bikes`.
4343

44-
```redis Create a new HLL set
44+
```redis:[run_confirmation=true] Create a new HLL set
4545
PFADD commuter_bikes Salacia Mimas Quaoar
4646
```
4747

@@ -51,12 +51,12 @@ PFCOUNT bikes commuter_bikes // returns 6 because Quaoar was present on both HLL
5151

5252
Use the `PFMERGE` command to merge two HLLs into a single HLL. Note: if the destination key already contains a HLL, it's data will be part of the merged data.
5353

54-
```redis Merge bikes and commuter_bikes
54+
```redis:[run_confirmation=true] Merge bikes and commuter_bikes
5555
PFMERGE all_bikes bikes commuter_bikes
5656
```
5757

5858
Now get the cardinality of `all_bikes`:
5959

6060
```redis Get the cardinality of all_bikes
6161
PFCOUNT all_bikes
62-
```
62+
```

0 commit comments

Comments
 (0)