Back to Redis

TDIGEST.ADD

content/commands/tdigest.add.md

latest1.7 KB
Original Source

Adds one or more observations to a t-digest sketch.

Required arguments

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

is the key name for an existing t-digest sketch.

</details> <details open><summary><code>value</code></summary>

is the floating-point value of an observation.

</details>

Examples

{{< highlight bash >}} redis> TDIGEST.ADD t 1 2 3 OK {{< / highlight >}}

{{< highlight bash >}} redis> TDIGEST.ADD t string (error) ERR T-Digest: error parsing val parameter {{< / highlight >}}

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="tdigest-add-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: the given key does not exist or the value parameter is of the incorrect type.

-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: the given key does not exist or the value parameter is of the incorrect type.

{{< /multitabs >}}