Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions content/commands/cms.incrby.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,30 @@ Increases the count of item by increment. Multiple items can be increased with o
* **item**: The item which counter is to be increased.
* **increment**: Amount by which the item counter is to be increased.

## Return


[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) with an updated min-count of each of the items in the sketch.

Count of each item after increment.

## Examples

```
redis> CMS.INCRBY test foo 10 bar 42
1) (integer) 10
2) (integer) 42
```

## Return information

{{< multitabs id=“cms-incrby-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:

* [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [integer replies]({{< relref "/develop/reference/protocol-spec#integers" >}}) representing updated min-counts of each of the provided items in the sketch.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, missing key, overflow, or wrong key type.

-tab-sep-

One of the following:

* [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [integer replies]({{< relref "/develop/reference/protocol-spec#integers" >}}) representing updated min-counts of each of the provided items in the sketch.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, missing key, overflow, or wrong key type.

{{< /multitabs >}}
22 changes: 18 additions & 4 deletions content/commands/cms.info.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ Returns width, depth and total count of the sketch.

* **key**: The name of the sketch.

## Return

[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with information of the filter.

## Examples

```
Expand All @@ -50,3 +46,21 @@ redis> CMS.INFO test
5) count
6) (integer) 0
```

{{< multitabs id=“cms-info-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:

* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) and [integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) pairs containing sketch information.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, missing key, or wrong key type.

-tab-sep-

One of the following:

* [Map reply]({{< relref "/develop/reference/protocol-spec#maps" >}}) of [simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) and [integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) pairs containing sketch information.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, missing key, or wrong key type.

{{< /multitabs >}}
26 changes: 21 additions & 5 deletions content/commands/cms.initbydim.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,29 @@ Initializes a Count-Min Sketch to dimensions specified by user.
* **depth**: Number of counter-arrays. Reduces the probability for an
error of a certain size (percentage of total count).

## Return

[Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - `OK` if executed correctly, or [] otherwise.

## Examples

```
redis> CMS.INITBYDIM test 2000 5
OK
```
```

## Return information

{{< multitabs id=“cms-initbydim-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:

* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) `OK` if executed correctly.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if the given key already exists.

-tab-sep-

One of the following:

* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) `OK` if executed correctly.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if the given key already exists.

{{< /multitabs >}}
28 changes: 22 additions & 6 deletions content/commands/cms.initbyprob.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,31 @@ Initializes a Count-Min Sketch to accommodate requested tolerances.
be a decimal value between 0 and 1. This effects the depth of the sketch.
For example, for a desired false positive rate of 0.1% (1 in 1000),
error_rate should be set to 0.001. The closer this number is to zero, the
greater the memory consumption per item and the more CPU usage per operation.

## Return

[Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - `OK` if executed correctly, or [] otherwise.
greater the memory consumption per item and the more CPU usage per operation.

## Examples

```
redis> CMS.INITBYPROB test 0.001 0.01
OK
```
```

## Return information

{{< multitabs id=“cms-initbyprob-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:

* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) `OK` if executed correctly.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if the given key already exists.

-tab-sep-

One of the following:

* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) `OK` if executed correctly.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) if the given key already exists.

{{< /multitabs >}}
24 changes: 20 additions & 4 deletions content/commands/cms.merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,29 @@ Merges several sketches into one sketch. All sketches must have identical width
* **src**: Names of source sketches to be merged.
* **weight**: Multiple of each sketch. Default =1.

## Return

[Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) - `OK` if executed correctly, or [] otherwise.

## Examples

```
redis> CMS.MERGE dest 2 test1 test2 WEIGHTS 1 3
OK
```

## Return information

{{< multitabs id=“cms-merge-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:

* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) `OK` if executed correctly.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: non-existent key or destination key is not of the same width and/or depth.

-tab-sep-

One of the following:

* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}) `OK` if executed correctly.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: non-existent key or destination key is not of the same width and/or depth.

{{< /multitabs >}}
26 changes: 19 additions & 7 deletions content/commands/cms.query.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,28 @@ Returns the count for one or more items in a sketch.
* **key**: The name of the sketch.
* **item**: One or more items for which to return the count.

## Return

Count of one or more items

[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}) with a min-count of each of the items in the sketch.

## Examples

```
redis> CMS.QUERY test foo bar
1) (integer) 10
2) (integer) 42
```
```

{{< multitabs id=“cms-merge-return-info"
tab1="RESP2"
tab2="RESP3" >}}

One of the following:

* [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [integer replies]({{< relref "/develop/reference/protocol-spec#integers" >}}) representing the min-counts of each of the provided items in the sketch.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, missing key, or wrong key type.

-tab-sep-

One of the following:

* [Array]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [integer replies]({{< relref "/develop/reference/protocol-spec#integers" >}}) representing the min-counts of each of the provided items in the sketch.
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: invalid arguments, missing key, or wrong key type.

{{< /multitabs >}}