Skip to content

Redis Open Source 8.2 docs #1884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Aug 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a07a654
Add doc for used_memory_peak_time per yzc-yzc
dwdougherty Jun 16, 2025
4db81aa
DOC-5368: update VSIM command page for ROS8.2 (#1765)
dwdougherty Jun 26, 2025
a0559a3
DOC-5367: update bitmap docs for ROS8.2 (#1759)
dwdougherty Jun 26, 2025
62afd23
DOC-5371: new CLUSTER SLOT-STATS command page for ROS8.2 (#1773)
dwdougherty Jun 30, 2025
f1d1b24
Merge branch 'main' into feat-ros-8.2
dwdougherty Jun 30, 2025
5084029
Merge branch 'feat-ros-8.2' of github.com:redis/docs into feat-ros-8.2
dwdougherty Jun 30, 2025
f9a650f
Merge branch 'main' into feat-ros-8.2
dwdougherty Jul 1, 2025
ff28306
DOC-5412: update KSN page for ROS8.2 (#1789)
dwdougherty Jul 1, 2025
493e989
DOC-5366: write new streams docs for ROS8.2 (#1788)
dwdougherty Jul 3, 2025
691afdb
Merge branch 'main' into feat-ros-8.2
dwdougherty Jul 3, 2025
6e3e89d
Merge branch 'feat-ros-8.2' of github.com:redis/docs into feat-ros-8.2
dwdougherty Jul 3, 2025
58d847e
DOC-5423: update the modules API page (#1815)
dwdougherty Jul 7, 2025
4df4443
Merge branch 'feat-ros-8.2' of github.com:redis/docs into feat-ros-8.2
dwdougherty Jul 7, 2025
12f3937
Merge branch 'main' into feat-ros-8.2
dwdougherty Jul 7, 2025
215076b
Fix docs about the A param of KSN config (#1803)
minchopaskal Jul 8, 2025
afdd787
Merge branch 'main' into feat-ros-8.2
dwdougherty Jul 8, 2025
b35f6d1
Merge branch 'feat-ros-8.2' of github.com:redis/docs into feat-ros-8.2
dwdougherty Jul 8, 2025
20259b6
DOC-5457: add the new SVS-VAMANA vector algorithm type (#1822)
dwdougherty Jul 9, 2025
bbe12e5
Merge branch 'main' into feat-ros-8.2
dwdougherty Jul 18, 2025
73361fe
Merge branch 'main' into feat-ros-8.2
dwdougherty Jul 23, 2025
bbd5fca
DOC-5491: add new CASE function and also augment the SVS_VAMANA chang…
dwdougherty Jul 24, 2025
483e235
DOC-5495: modify vector set docs for 8.2 (initial commit) (#1875)
dwdougherty Jul 28, 2025
030fe0e
DOC-5504: update modules API doc (#1882)
dwdougherty Jul 28, 2025
4681435
Merge branch 'main' into feat-ros-8.2
dwdougherty Jul 28, 2025
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
67 changes: 58 additions & 9 deletions content/commands/bitop.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ arguments:
name: not
token: NOT
type: pure-token
- display_text: diff
name: diff
token: DIFF
type: pure-token
- display_text: diff1
name: diff1
token: DIFF1
type: pure-token
- display_text: andor
name: andor
token: ANDOR
type: pure-token
- display_text: one
name: one
token: ONE
type: pure-token
name: operation
type: oneof
- display_text: destkey
Expand Down Expand Up @@ -78,26 +94,45 @@ key_specs:
linkTitle: BITOP
since: 2.6.0
summary: Performs bitwise operations on multiple strings, and stores the result.
syntax_fmt: BITOP <AND | OR | XOR | NOT> destkey key [key ...]
syntax_fmt: "BITOP <AND | OR | XOR | NOT | DIFF | DIFF1 | ANDOR | ONE> destkey key [key ...]"
syntax_str: destkey key [key ...]
title: BITOP
---
Perform a bitwise operation between multiple keys (containing string values) and
store the result in the destination key.

The `BITOP` command supports four bitwise operations: **AND**, **OR**, **XOR**
and **NOT**, thus the valid forms to call the command are:
The `BITOP` command supports eight bitwise operations: `AND`, `OR`, `XOR`,
`NOT`, `DIFF`, `DIFF1`, `ANDOR`, and `ONE`. The valid forms to call the command are:


* `BITOP AND destkey srckey1 srckey2 srckey3 ... srckeyN`

A bit in `destkey` is set only if it is set in all source bitmaps.
* `BITOP OR destkey srckey1 srckey2 srckey3 ... srckeyN`

A bit in `destkey` is set only if it is set in at least one source bitmap.
* `BITOP XOR destkey srckey1 srckey2 srckey3 ... srckeyN`

Mostly used with two source bitmaps, a bit in `destkey` is set only if its value differs between the two source bitmaps.
* `BITOP NOT destkey srckey`

As you can see **NOT** is special as it only takes an input key, because it
performs inversion of bits so it only makes sense as a unary operator.
`NOT` is a unary operator and only supports a single source bitmap; set the bit to the inverse of its value in the source bitmap.
* `BITOP DIFF destkey X [Y1 Y2 ...]` <sup>[1](#list-note-1)</sup>

A bit in `destkey` is set if it is set in `X`, but not in any of `Y1, Y2, ...` .
* `BITOP DIFF1 destkey X [Y1 Y2 ...]` <sup>[1](#list-note-1)</sup>

The result of the operation is always stored at `destkey`.
A bit in `destkey` is set if it is set in one or more of `Y1, Y2, ...`, but not in `X`.
* `BITOP ANDOR destkey X [Y1 Y2 ...]` <sup>[1](#list-note-1)</sup>

A bit in `destkey` is set if it is set in `X` and also in one or more of `Y1, Y2, ...`.
* `BITOP ONE destkey X1 [X2 X3 ...]` <sup>[1](#list-note-1)</sup>

A bit in `destkey` is set if it is set in exactly one of `X1, X2, ...`.

The result of each operation is always stored at `destkey`.

1. <a name="list-note-1"></a> Added in Redis 8.2.

## Handling of strings with different lengths

Expand All @@ -110,13 +145,27 @@ zero bytes up to the length of the longest string.

## Examples

1. Basic usage example using the `AND` operator:

{{% redis-cli %}}
SET key1 "foobar"
SET key2 "abcdef"
BITFIELD key1 SET i8 #0 255
BITFIELD key2 SET i8 #0 85
BITOP AND dest key1 key2
GET dest
BITFIELD dest GET i8 #0
{{% /redis-cli %}}

2. Suppose you want to expose people to a book-related ad. The target audience is people who love to read books and are interested in fantasy, adventure, or science fiction. Assume you have the following bitmaps:

* `LRB` - people who love to read books.
* `B:F` - people interested in fantasy.
* `B:A` - people interested in adventure.
* `B:SF` - people interested in science fiction.

To create a bitmap representing the target audience, use the following command:

```
BITOP ANDOR TA LRB B:F B:A B:SF
```

## Pattern: real time metrics using bitmaps

Expand Down
129 changes: 129 additions & 0 deletions content/commands/cluster-slot-stats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
arguments:
- arguments:
- arguments:
- name: start-slot
type: integer
- name: end-slot
type: integer
name: slotsrange
token: SLOTSRANGE
type: block
- arguments:
- name: metric
type: string
- name: limit
optional: true
token: LIMIT
type: integer
- arguments:
- name: asc
token: ASC
type: pure-token
- name: desc
token: DESC
type: pure-token
name: order
optional: true
type: oneof
name: orderby
token: ORDERBY
type: block
name: filter
type: oneof
arity: -4
categories:
- docs
- develop
- stack
- oss
- rs
- rc
- oss
- kubernetes
- clients
command_flags:
- STALE
- LOADING
command_tips:
- NONDETERMINISTIC_OUTPUT
- REQUEST_POLICY:ALL_SHARDS
complexity: O(N) where N is the total number of slots based on arguments. O(N*log(N))
with ORDERBY subcommand.
container: CLUSTER
description: Return an array of slot usage statistics for slots assigned to the current
node.
function: clusterSlotStatsCommand
group: cluster
hidden: false
linkTitle: CLUSTER SLOT-STATS
reply_schema:
description: Array of nested arrays, where the inner array element represents a
slot and its respective usage statistics.
items:
description: Array of size 2, where 0th index represents (int) slot and 1st index
represents (map) usage statistics.
items:
- description: Slot Number.
type: integer
- additionalProperties: false
description: Map of slot usage statistics.
properties:
cpu-usec:
type: integer
key-count:
type: integer
network-bytes-in:
type: integer
network-bytes-out:
type: integer
type: object
maxItems: 2
minItems: 2
type: array
type: array
since: 8.2.0
summary: Return an array of slot usage statistics for slots assigned to the current
node.
syntax_fmt: "CLUSTER SLOT-STATS <SLOTSRANGE\_start-slot end-slot | ORDERBY\_metric\n [LIMIT\_\
limit] [ASC | DESC]>"
syntax_str: ''
title: CLUSTER SLOT-STATS
---

Use this command to get an array of slot usage statistics for the slots assigned to the current shard. If you're working with a Redis cluster, this data helps you understand overall slot usage, spot hot or cold slots, plan slot migrations to balance load, or refine your application logic to better distribute keys.

## Options

`CLUSTER SLOT-STATS` has two mutually exclusive options:

* `ORDERBY`: Sorts the slot statistics by the specified metric. Use ASC or DESC to sort in ascending or descending order. If multiple slots have the same value, the command uses the slot number as a tiebreaker, sorted in ascending order.

* `SLOTSRANGE`: Limits the results to a specific, inclusive range of slots. Results are always sorted by slot number in ascending order.

The command reports on the following statistics:

* `KEY-COUNT`: Number of keys stored in the slot.
* `CPU-USEC`: CPU time (in microseconds) spent handling the slot.
* `NETWORK-BYTES-IN`: Total inbound network traffic (in bytes) received by the slot.
* `NETWORK-BYTES-OUT`: Total outbound network traffic (in bytes) sent from the slot.

## Return information

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

One of the following:

* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): a nested list of slot usage statistics.
* [Simple error]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) otherwise.

-tab-sep-

One of the following:

* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): a nested list of slot usage statistics.
* [Simple error]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) otherwise.

{{< /multitabs >}}
21 changes: 21 additions & 0 deletions content/commands/ft.aggregate.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,27 @@ Next, count GitHub events by user (actor), to produce the most active users.

</details>

<details open>
<summary><b>Use the case function for conditional logic</b></summary>
{{< highlight bash >}}
//Simple mapping
FT.AGGREGATE products "*"
APPLY case(@price > 100, "premium", "standard") AS category

//Nested conditions where an error should be returned
FT.AGGREGATE orders "*"
APPLY case(@status == "pending",
case(@priority == "high", 1, 2),
case(@status == "completed", 3, 4)) AS status_code

//Mapped approach
FT.AGGREGATE orders "*"
APPLY case(@status == "pending", 1, 0) AS is_pending
APPLY case(@is_pending == 1 && @priority == "high", 1,2) AS status_high
APPLY case(@is_pending == 0 && @priority == "high", 3,4) AS status_completed
{{< / highlight >}}

</details>
## Return information

{{< multitabs id="ft-aggregate-return-info"
Expand Down
1 change: 1 addition & 0 deletions content/commands/info.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Here is the meaning of all fields in the **memory** section:
* `used_memory_rss_human`: Human readable representation of previous value
* `used_memory_peak`: Peak memory consumed by Redis (in bytes)
* `used_memory_peak_human`: Human readable representation of previous value
* `used_memory_peak_time`: Time when peak memory was recorded
* `used_memory_peak_perc`: The percentage of `used_memory` out of `used_memory_peak`
* `used_memory_overhead`: The sum in bytes of all overheads that the server
allocated for managing its internal data structures
Expand Down
66 changes: 66 additions & 0 deletions content/commands/vismember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
arguments:
- name: key
type: key
- name: element
type: string
arity: 3
categories:
- docs
- develop
- stack
- oss
- rs
- rc
- oss
- kubernetes
- clients
command_flags:
- READONLY
complexity: O(1)
description: Check if an element exists in a vector set.
function: vismemberCommand
group: vector_set
hidden: false
linkTitle: VISMEMBER
since: 8.0.0
summary: Check if an element exists in a vector set.
syntax_fmt: VISMEMBER key element
syntax_str: element
title: VISMEMBER
bannerText: Vector set is a new data type that is currently in preview and may be subject to change.
---

Check if an element exists in a vector set.

## Required arguments

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

is the name of the key that holds the vector set.
</details>

<details open>
<summary><code>element</code></summary>

is the name of the element you want to check for membership.
</details>

## Related topics

- [Vector sets]({{< relref "/develop/data-types/vector-sets" >}})

## Return information

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

[Integer reply](../../develop/reference/protocol-spec#integers): `0` if the element does not exist in the vector set, or the key does not exist. `1` if the element exists in the vector set.

-tab-sep-

[Boolean reply](../../develop/reference/protocol-spec#booleans): `false` if the element does not exist in the vector set, or the key does not exist. `true` if the element exists in the vector set.

{{< /multitabs >}}
8 changes: 2 additions & 6 deletions content/commands/vrem.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ categories:
- kubernetes
- clients
complexity: O(log(N)) for each element removed, where N is the number of elements in the vector set.
description: Remove one or more elements from a vector set.
description: Remove an element from a vector set.
group: vector_set
hidden: false
linkTitle: VREM
since: 8.0.0
summary: Remove one or more elements from a vector set.
summary: Remove an element from a vector set.
syntax_fmt: "VREM key element"
title: VREM
bannerText: Vector set is a new data type that is currently in preview and may be subject to change.
Expand All @@ -26,14 +26,10 @@ Remove an element from a vector set.
```shell
VADD vset VALUES 3 1 0 1 bar
(integer) 1
```

```shell
VREM vset bar
(integer) 1
```

```shell
VREM vset bar
(integer) 0
```
Expand Down
Loading