# TOPK.INCRBY

```json metadata
{
  "schema_version": 2,
  "title": "TOPK.INCRBY",
  "description": "Increases the count of one or more items by increment",
  "categories": ["docs","develop","stack","oss","rs","rc","oss","kubernetes","clients"],
  "arguments": [{"name":"key","type":"key"},{"arguments":[{"name":"item","type":"string"},{"name":"increment","type":"integer"}],"multiple":true,"name":"items","type":"block"}],
  "syntax_fmt": "TOPK.INCRBY key item increment [item increment ...]",
  "complexity": "O(n * k * incr) where n is the number of items, k is the depth and incr is the increment",
  "group": "topk",
  "acl_categories": ["@topk","@write","@slow"],
  "since": "2.0.0",
  "tableOfContents": {"sections":[{"id":"required-arguments","title":"Required arguments"},{"id":"examples","title":"Examples"},{"id":"redis-software-and-redis-cloud-compatibility","title":"Redis Software and Redis Cloud compatibility"},{"id":"return-information","title":"Return information"}]}

,
  "codeExamples": []
}
```

Increase the score of an item in the data structure by `increment`. 
Multiple items' scores can be increased at once.
If an item enters the Top-K list, the item that is expelled (if any) is returned.

## Required arguments

<details open><summary><code>key</code></summary>

the name of the sketch.

</details>

<details open><summary><code>item increment [item increment ...]</code></summary>

One or more item-increment pairs. Each `item` is incremented by its corresponding `increment`. The `increment` must be greater than or equal to 1 and less than or equal to 100,000 to avoid server freeze.

</details>

## Examples

```
redis> TOPK.INCRBY topk foo 3 bar 2 42 30
1) (nil)
2) (nil)
3) foo
```

## Redis Software and Redis Cloud compatibility

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

## Return information

**RESP2:**

One of the following:

* [Array](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) of [bulk string replies](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) containing either dropped elements or [nil (null bulk string)](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings).
* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: incorrect number of arguments, non-existant key, key of the incorrect type, or an incorrect increment (less than 0 or greater than 100,000).

**RESP3:**

One of the following:

* [Array](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) of [bulk string replies](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) containing either dropped elements or [null](https://redis.io/docs/latest/develop/reference/protocol-spec#nulls).
* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: incorrect number of arguments, non-existant key, key of the incorrect type, or an incorrect increment (less than 0 or greater than 100,000).


