Back to Redis

CMS.INCRBY

content/commands/cms.incrby.md

latest1.7 KB
Original Source

Increases the count of item by increment. Multiple items can be increased with one call.

Parameters:

  • key: The name of the sketch.
  • item: The item which counter is to be increased.
  • increment: Amount by which the item counter is to be increased.

Examples

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

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported"><nobr>✅ Flexible & Annual</nobr></span> <span title="Supported">✅ Free & Fixed</nobr></span> | |

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 >}}