title: HSET

summary: Creates or modifies the value of a field in a hash.

title: Examples

text:
#### Code Examples

Foundational: Set one or more field-value pairs in a hash using HSET (creates hash if needed, overwrites existing fields, returns count of new fields)

**Difficulty:** Beginner

**Commands:** HSET, HGET, HGETALL

**Complexity:**
- HSET: O(1)
- HGET: O(1)
- HGETALL: O(N)

**Redis CLI:**

[code example]

**Available in:** Redis CLI, C, C# (Synchronous), Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), JavaScript (Node.js), PHP, Python, Rust (Asynchronous), Rust (Synchronous)

**C:**

[code example]

**C# (Synchronous):**

[code example]

**Go:**

[code example]

**Java (Asynchronous - Lettuce):**

[code example]

**Java (Reactive - Lettuce):**

[code example]

**Java (Synchronous - Jedis):**

[code example]

**JavaScript (Node.js):**

[code example]

**JavaScript (Node.js):**

[code example]

**JavaScript (Node.js):**

[code example]

**JavaScript (Node.js):**

[code example]

**PHP:**

[code example]

**Python:**

[code example]

**Rust (Asynchronous):**

[code example]

**Rust (Synchronous):**

[code example]

Give these commands a try in the interactive console:

HSET myhash field1 "Hello"
HGET myhash field1
HSET myhash field2 "Hi" field3 "World"
HGET myhash field2
HGET myhash field3
HGETALL myhash

text:
| Redis
Software | Redis
Cloud | Notes |
|:----------------------|:-----------------|:------|
| ✅ Standard
<nobr>✅ Active-Active</nobr> | ✅ Standard
<nobr>✅ Active-Active</nobr> |  |

title: Return information

text:
**RESP2:**

[Integer reply](../../develop/reference/protocol-spec#integers): the number of fields that were added.

**RESP3:**

[Integer reply](../../develop/reference/protocol-spec#integers): the number of fields that were added.

code:
> HSET myhash field1 "Hello"
(integer) 1
> HGET myhash field1
"Hello"
> HSET myhash field2 "Hi" field3 "World"
(integer) 2
> HGET myhash field2
"Hi"
> HGET myhash field3
"World"
> HGETALL myhash
1) "field1"
2) "Hello"
3) "field2"
4) "Hi"
5) "field3"
6) "World"

code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <hiredis/hiredis.h>

int main(int argc, char **argv) {
    redisContext *c = redisConnect("127.0.0.1", 6379);

    if (c == NULL || c->err) {
        if (c) {
            printf("Connection error: %s\n", c->errstr);
            redisFree(c);
        } else {
            printf("Connection error: can't allocate redis context\n");
        }
        return 1;
    }

    redisReply *reply;

    // Set up hash with fields
    reply = redisCommand(c, "HSET %s %s %s %s %s",
        "myhash", "field1", "Hello", "field2", "World");
    freeReplyObject(reply);

    // Get multiple fields at once
    reply = redisCommand(c, "HMGET %s %s %s %s",
        "myhash", "field1", "field2", "nofield");

    printf("HMGET myhash field1 field2 nofield:\n");
    for (size_t i = 0; i < reply->elements; i++) {
        if (reply->element[i]->type == REDIS_REPLY_NIL) {
            printf("  [%zu]: null\n", i);
        } else {
            printf("  [%zu]: %s\n", i, reply->element[i]->str);
        }
    }
    // >>> [0]: Hello
    // >>> [1]: World
    // >>> [2]: null

    freeReplyObject(reply);

    redisFree(c);

    return 0;
}

code:
bool hsetRes1 = db.HashSet("myhash", "field1", "Hello");
        RedisValue hsetRes2 = db.HashGet("myhash", "field1");
        Console.WriteLine(hsetRes2);    // >>> Hello

        db.HashSet(
            "myhash",
            [
                new("field2", "Hi"),
                new("field3", "World")
            ]
        );

        RedisValue hsetRes3 = db.HashGet("myhash", "field2");
        Console.WriteLine(hsetRes3);    // >>> Hi

        RedisValue hsetRes4 = db.HashGet("myhash", "field3");
        Console.WriteLine(hsetRes4);    // >>> World

        HashEntry[] hsetRes5 = db.HashGetAll("myhash");
        Console.WriteLine($"{string.Join(", ", hsetRes5.Select(h => $"{h.Name}: {h.Value}"))}");
        // >>> field1: Hello, field2: Hi, field3: World

code:
res1, err := rdb.HSet(ctx, "myhash", "field1", "Hello").Result()

	if err != nil {
		panic(err)
	}

	fmt.Println(res1) // >>> 1

	res2, err := rdb.HGet(ctx, "myhash", "field1").Result()

	if err != nil {
		panic(err)
	}

	fmt.Println(res2) // >>> Hello

	res3, err := rdb.HSet(ctx, "myhash",
		"field2", "Hi",
		"field3", "World",
	).Result()

	if err != nil {
		panic(err)
	}

	fmt.Println(res3) // >>> 2

	res4, err := rdb.HGet(ctx, "myhash", "field2").Result()

	if err != nil {
		panic(err)
	}

	fmt.Println(res4) // >>> Hi

	res5, err := rdb.HGet(ctx, "myhash", "field3").Result()

	if err != nil {
		panic(err)
	}

	fmt.Println(res5) // >>> World

	res6, err := rdb.HGetAll(ctx, "myhash").Result()

	if err != nil {
		panic(err)
	}

	keys := make([]string, 0, len(res6))

	for key, _ := range res6 {
		keys = append(keys, key)
	}

	sort.Strings(keys)

	for _, key := range keys {
		fmt.Printf("Key: %v, value: %v\n", key, res6[key])
	}
	// >>> Key: field1, value: Hello
	// >>> Key: field2, value: Hi
	// >>> Key: field3, value: World

code:
CompletableFuture<Void> hSetExample = asyncCommands.hset("myhash", "field1", "Hello").thenCompose(res1 -> {
                System.out.println(res1); // >>> 1
                return asyncCommands.hget("myhash", "field1");
            }).thenCompose(res2 -> {
                System.out.println(res2); // >>> Hello
                Map<String, String> hSetExampleParams = new HashMap<>();
                hSetExampleParams.put("field2", "Hi");
                hSetExampleParams.put("field3", "World");
                return asyncCommands.hset("myhash", hSetExampleParams);
            }).thenCompose(res3 -> {
                System.out.println(res3); // >>> 2
                return asyncCommands.hget("myhash", "field2");
            }).thenCompose(res4 -> {
                System.out.println(res4); // >>> Hi
                return asyncCommands.hget("myhash", "field3");
            }).thenCompose(res5 -> {
                System.out.println(res5); // >>> World
                return asyncCommands.hgetall("myhash");
            }).thenAccept(res6 -> {
                System.out.println(res6);
                // >>> {field1=Hello, field2=Hi, field3=World}
            }).toCompletableFuture();

code:
Mono<Boolean> hSetExample1 = reactiveCommands.hset("myhash", "field1", "Hello").doOnNext(result -> {
                System.out.println(result); // >>> True
            });

            hSetExample1.block();

            Mono<String> hSetExample2 = reactiveCommands.hget("myhash", "field1").doOnNext(result -> {
                System.out.println(result); // >>> Hello
            });

            hSetExample2.block();

            Map<String, String> hSetExampleParams = new HashMap<>();
            hSetExampleParams.put("field2", "Hi");
            hSetExampleParams.put("field3", "World");

            Mono<Long> hSetExample3 = reactiveCommands.hset("myhash", hSetExampleParams).doOnNext(result -> {
                System.out.println(result); // >>> 2
            });

            hSetExample3.block();

            Mono<String> hSetExample4 = reactiveCommands.hget("myhash", "field2").doOnNext(result -> {
                System.out.println(result); // >>> Hi
            });

            hSetExample4.block();

            Mono<String> hSetExample5 = reactiveCommands.hget("myhash", "field3").doOnNext(result -> {
                System.out.println(result); // >>> World
            });

            hSetExample5.block();

            Mono<Map<String, String>> hSetExample6 = reactiveCommands.hgetall("myhash").collectMap(
                    KeyValue::getKey, KeyValue::getValue
            ).doOnNext(result -> {
                System.out.println(result);
                // >>> {field1=Hello, field2=Hi, field3=World}
            });

code:
Map<String, String> hSetExampleParams = new HashMap<>();
        hSetExampleParams.put("field1", "Hello");
        long hSetResult1 = jedis.hset("myhash", hSetExampleParams);
        System.out.println(hSetResult1);    // >>> 1

        String hSetResult2 = jedis.hget("myhash", "field1");
        System.out.println(hSetResult2);    // >>> Hello

        hSetExampleParams.clear();
        hSetExampleParams.put("field2", "Hi");
        hSetExampleParams.put("field3", "World");
        long hSetResult3 = jedis.hset("myhash",hSetExampleParams);
        System.out.println(hSetResult3);    // >>> 2

        String hSetResult4 = jedis.hget("myhash", "field2");
        System.out.println(hSetResult4);    // >>> Hi

        String hSetResult5 = jedis.hget("myhash", "field3");
        System.out.println(hSetResult5);    // >>> World

        Map<String, String> hSetResult6 = jedis.hgetAll("myhash");

        for (String key: hSetResult6.keySet()) {
            System.out.println("Key: " + key + ", Value: " + hSetResult6.get(key));
        }
        // >>> Key: field3, Value: World
        // >>> Key: field2, Value: Hi
        // >>> Key: field1, Value: Hello

code:
const res1 = await client.hSet('myhash', 'field1', 'Hello')
console.log(res1) // 1

const res2 = await client.hGet('myhash', 'field1')
console.log(res2) // Hello

const res3 = await client.hSet(
  'myhash',
  {
    'field2': 'Hi',
    'field3': 'World'
  }
)
console.log(res3) // 2

const res4 = await client.hGet('myhash', 'field2')
console.log(res4) // Hi

const res5 = await client.hGet('myhash', 'field3')
console.log(res5) // World

const res6 = await client.hGetAll('myhash')
console.log(res6)

code:
import assert from 'node:assert';
import { Redis } from 'ioredis';

const redis = new Redis();

await redis.hset('myhash', { field1: 'Hello', field2: 'World' });

const hmgetResult = await redis.hmget('myhash', 'field1', 'field2', 'nofield');
console.log(hmgetResult); // >>> ['Hello', 'World', null]

redis.disconnect();

code:
$hSetResult1 = $this->redis->hset('myhash', 'field1', 'Hello');
        echo "HSET myhash field1 Hello: " . $hSetResult1 . "\n"; // >>> 1

        $hSetResult2 = $this->redis->hget('myhash', 'field1');
        echo "HGET myhash field1: " . $hSetResult2 . "\n"; // >>> Hello

        $hSetResult3 = $this->redis->hmset('myhash', ['field2' => 'Hi', 'field3' => 'World']);
        echo "HMSET myhash field2 Hi field3 World: " . ($hSetResult3 ? 'OK' : 'FAIL') . "\n"; // >>> OK

        $hSetResult4 = $this->redis->hget('myhash', 'field2');
        echo "HGET myhash field2: " . $hSetResult4 . "\n"; // >>> Hi

        $hSetResult5 = $this->redis->hget('myhash', 'field3');
        echo "HGET myhash field3: " . $hSetResult5 . "\n"; // >>> World

        $hSetResult6 = $this->redis->hgetall('myhash');
        echo "HGETALL myhash: ";
        foreach ($hSetResult6 as $key => $value) {
            echo "Key: $key, Value: $value; ";
        }
        echo "\n";

code:
res1 = r.hset("myhash", "field1", "Hello")
print(res1)
# >>> 1

res2 = r.hget("myhash", "field1")
print(res2)
# >>> Hello

res3 = r.hset("myhash", mapping={"field2": "Hi", "field3": "World"})
print(res3)
# >>> 2

res4 = r.hget("myhash", "field2")
print(res4)
# >>> Hi

res5 = r.hget("myhash", "field3")
print(res5)
# >>> World

res6 = r.hgetall("myhash")
print(res6)
# >>> { "field1": "Hello", "field2": "Hi", "field3": "World" }

code:
match r.hset("myhash", "field1", "Hello").await {
            Ok(res1) => {
                let res1: i32 = res1;
                println!("{res1}");    // >>> 1
            },
            Err(e) => {
                println!("Error setting hash field: {e}");
                return;
            }
        }

        match r.hget("myhash", "field1").await {
            Ok(res2) => {
                let res2: Option<String> = res2;
                match res2 {
                    Some(value) => {
                        println!("{value}");    // >>> Hello
                    },
                    None => {
                        println!("None");
                    }
                }
            },
            Err(e) => {
                println!("Error getting hash field: {e}");
                return;
            }
        }

        // Set multiple fields using hset_multiple
        let hash_fields = [
            ("field2", "Hi"),
            ("field3", "World"),
        ];

        if let Ok(res) = r.hset_multiple("myhash", &hash_fields).await {
            let res: String = res;
            println!("{res}");    // >>> OK
        }

        match r.hget("myhash", "field2").await {
            Ok(res4) => {
                let res4: Option<String> = res4;
                match res4 {
                    Some(value) => {
                        println!("{value}");    // >>> Hi
                    },
                    None => {
                        println!("None");
                    }
                }
            },
            Err(e) => {
                println!("Error getting hash field: {e}");
                return;
            }
        }

        match r.hget("myhash", "field3").await {
            Ok(res5) => {
                let res5: Option<String> = res5;
                match res5 {
                    Some(value) => {
                        println!("{value}");    // >>> World
                    },
                    None => {
                        println!("None");
                    }
                }
            },
            Err(e) => {
                println!("Error getting hash field: {e}");
                return;
            }
        }

        match r.hgetall("myhash").await {
            Ok(res6) => {
                let res6: HashMap<String, String> = res6;
                println!("{res6:?}");    // >>> {"field1": "Hello", "field2": "Hi", "field3": "World"}
            },
            Err(e) => {
                println!("Error getting all hash fields: {e}");
                return;
            }
        }

code:
match r.hset("myhash", "field1", "Hello") {
            Ok(res1) => {
                let res1: i32 = res1;
                println!("{res1}");    // >>> 1
            },
            Err(e) => {
                println!("Error setting hash field: {e}");
                return;
            }
        }

        match r.hget("myhash", "field1") {
            Ok(res2) => {
                let res2: Option<String> = res2;
                match res2 {
                    Some(value) => {
                        println!("{value}");    // >>> Hello
                    },
                    None => {
                        println!("None");
                    }
                }
            },
            Err(e) => {
                println!("Error getting hash field: {e}");
                return;
            }
        }

        // Set multiple fields using hset_multiple
        let hash_fields = [
            ("field2", "Hi"),
            ("field3", "World"),
        ];

        if let Ok(res) = r.hset_multiple("myhash", &hash_fields) {
            let res: String = res;
            println!("{res}");    // >>> OK
        }

        match r.hget("myhash", "field2") {
            Ok(res4) => {
                let res4: Option<String> = res4;
                match res4 {
                    Some(value) => {
                        println!("{value}");    // >>> Hi
                    },
                    None => {
                        println!("None");
                    }
                }
            },
            Err(e) => {
                println!("Error getting hash field: {e}");
                return;
            }
        }

        match r.hget("myhash", "field3") {
            Ok(res5) => {
                let res5: Option<String> = res5;
                match res5 {
                    Some(value) => {
                        println!("{value}");    // >>> World
                    },
                    None => {
                        println!("None");
                    }
                }
            },
            Err(e) => {
                println!("Error getting hash field: {e}");
                return;
            }
        }

        match r.hgetall("myhash") {
            Ok(res6) => {
                let res6: HashMap<String, String> = res6;
                println!("{res6:?}");    // >>> {"field1": "Hello", "field2": "Hi", "field3": "World"}
            },
            Err(e) => {
                println!("Error getting all hash fields: {e}");
                return;
            }
        }


title: HSETEX

summary: Set the value of one or more fields of a given hash key, and optionally set their expiration.

page_type: content

title: Overview

role: overview

text:
Set the value of one or more fields of a given hash key and optionally
set their expiration time or time-to-live (TTL). If the given key already holds a value, it is overwritten and any previous TTLs associated with the key are discarded.

title: Options

role: parameters

text:
The `HSETEX` command supports a set of options:

* `FNX` -- Only set the fields if none of them already exist.
* `FXX` -- Only set the fields if all of them already exist.
* `EX seconds` -- Set the specified expiration time in seconds.
* `PX milliseconds` -- Set the specified expiration time in milliseconds.
* `EXAT unix-time-seconds` -- Set the specified Unix time in seconds at which the fields will expire.
* `PXAT unix-time-milliseconds` -- Set the specified Unix time in milliseconds at which the fields will expire.
* `KEEPTTL` -- Retain the TTL associated with the fields.

The `EX`, `PX`, `EXAT`, `PXAT`, and `KEEPTTL` options are mutually exclusive.

title: Example

role: example

text: [code example]

title: Redis Software and Redis Cloud compatibility

role: content

title: Return information

role: returns

text:
**RESP2:**

One of the following:
* [Integer reply](../../develop/reference/protocol-spec#integers): `0` if no fields were set.
* [Integer reply](../../develop/reference/protocol-spec#integers): `1` if all the fields wereset.

**RESP3:**

One of the following:
* [Integer reply](../../develop/reference/protocol-spec#integers): `0` if no fields were set.
* [Integer reply](../../develop/reference/protocol-spec#integers): `1` if all the fields wereset.

code:
redis> HSETEX mykey EXAT 1740470400 FIELDS 2 field1 "Hello" field2 "World"
(integer) 1
redis> HTTL mykey FIELDS 2 field1 field2
1) (integer) 55627
2) (integer) 55627
redis> HSETEX mykey FNX EX 60 FIELDS 2 field1 "Hello" field2 "World"
(integer) 0
redis> HSETEX mykey FXX EX 60 KEEPTTL FIELDS 2 field1 "hello" field2 "world"
(error) ERR Only one of EX, PX, EXAT, PXAT or KEEPTTL arguments can be specified
redis> HSETEX mykey FXX KEEPTTL FIELDS 2 field1 "hello" field2 "world"
(integer) 1
redis> HTTL mykey FIELDS 2 field1 field2
1) (integer) 55481
2) (integer) 55481

section_id: example


title: HSETNX

summary: Sets the value of a field in a hash only when the field doesn't exist.

title: Overview

text:
Sets `field` in the hash stored at `key` to `value`, only if `field` does not
yet exist.
If `key` does not exist, a new key holding a hash is created.
If `field` already exists, this operation has no effect.

title: Examples

text:
HSETNX myhash field "Hello"
HSETNX myhash field "World"
HGET myhash field

title: Return information

text:
**RESP2:**

One of the following:
* [Integer reply](../../develop/reference/protocol-spec#integers): `0` if the field already exists in the hash and no operation was performed.
* [Integer reply](../../develop/reference/protocol-spec#integers): `1` if the field is a new field in the hash and the value was set.

**RESP3:**

One of the following:
* [Integer reply](../../develop/reference/protocol-spec#integers): `0` if the field already exists in the hash and no operation was performed.
* [Integer reply](../../develop/reference/protocol-spec#integers): `1` if the field is a new field in the hash and the value was set.


title: HSTRLEN

summary: Returns the length of the value of a field.

title: Overview

text: Returns the string length of the value associated with `field` in the hash stored at `key`. If the `key` or the `field` do not exist, 0 is returned.

title: Examples

text:
HSET myhash f1 HelloWorld f2 99 f3 -256
HSTRLEN myhash f1
HSTRLEN myhash f2
HSTRLEN myhash f3

title: Return information

text:
**RESP2:**

[Integer reply](../../develop/reference/protocol-spec#integers): the string length of the value associated with the _field_, or zero when the _field_ isn't present in the hash or the _key_ doesn't exist at all.

**RESP3:**

[Integer reply](../../develop/reference/protocol-spec#integers): the string length of the value associated with the _field_, or zero when the _field_ isn't present in the hash or the _key_ doesn't exist at all.


title: HTTL

summary: Returns the TTL in seconds of a hash field.

title: Overview

text:
Returns the remaining TTL (time to live) of a hash key's field(s) that have a set expiration.
This introspection capability allows you to check how many seconds a
given hash field will continue to be part of the hash key.

See also the [`HPTTL`]() command that returns the same information with millisecond resolution.

title: Example

text: [code example]

title: Return information

text:
**RESP2:**

* [Array reply](../../develop/reference/protocol-spec#arrays). For each field:
    - [Integer reply](../../develop/reference/protocol-spec#integers): `-2` if no such field exists in the provided hash key, or the provided key does not exist.
    - [Integer reply](../../develop/reference/protocol-spec#integers): `-1` if the field exists but has no associated expiration set.
    - [Integer reply](../../develop/reference/protocol-spec#integers): the TTL in seconds.

**RESP3:**

* [Array reply](../../develop/reference/protocol-spec#arrays). For each field:
    - [Integer reply](../../develop/reference/protocol-spec#integers): `-2` if no such field exists in the provided hash key, or the provided key does not exist.
    - [Integer reply](../../develop/reference/protocol-spec#integers): `-1` if the field exists but has no associated expiration set.
    - [Integer reply](../../develop/reference/protocol-spec#integers): the TTL in seconds.

code:
redis> HTTL no-key FIELDS 3 field1 field2 field3
(nil)
redis> HSET mykey field1 "hello" field2 "world"
(integer) 2
redis> HEXPIRE mykey 300 FIELDS 2 field1 field3
1) (integer) 1
2) (integer) -2
redis> HTTL mykey FIELDS 3 field1 field2 field3
1) (integer) 283
2) (integer) -1
3) (integer) -2


title: HVALS

summary: Returns all values in a hash.

title: Examples

text:
#### Code Examples

Foundational: Retrieve all values from a hash using HVALS (returns only values without field names, useful when you only need the data)

**Difficulty:** Beginner

**Commands:** HSET, HVALS

**Complexity:**
- HSET: O(1)
- HVALS: O(N)

**Redis CLI:**

[code example]

**Available in:** Redis CLI, C, C# (Synchronous), Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), JavaScript (Node.js), PHP, Python, Rust (Asynchronous), Rust (Synchronous)

**C:**

[code example]

**C# (Synchronous):**

[code example]

**Go:**

[code example]

**Java (Asynchronous - Lettuce):**

[code example]

**Java (Reactive - Lettuce):**

[code example]

**Java (Synchronous - Jedis):**

[code example]

**JavaScript (Node.js):**

[code example]

**JavaScript (Node.js):**

[code example]

**JavaScript (Node.js):**

[code example]

**JavaScript (Node.js):**

[code example]

**PHP:**

[code example]

**Python:**

[code example]

**Rust (Asynchronous):**

[code example]

**Rust (Synchronous):**

[code example]

Give these commands a try in the interactive console:

HSET myhash field1 "Hello"
HSET myhash field2 "World"
HVALS myhash

title: Return information

text:
**RESP2:**

[Array reply](../../develop/reference/protocol-spec#arrays): a list of values in the hash, or an empty list when the key does not exist

**RESP3:**

[Array reply](../../develop/reference/protocol-spec#arrays): a list of values in the hash, or an empty list when the key does not exist.

code:
redis> HSET myhash field1 "Hello"
(integer) 1
redis> HSET myhash field2 "World"
(integer) 1
redis> HVALS myhash
1) "Hello"
2) "World"

section_id: examples

code:
db.HashSet("myhash",
            [
                new("field1", "Hello"),
                new("field2", "World")
            ]
        );

        RedisValue[] hValsResult = db.HashValues("myhash");
        Array.Sort(hValsResult);
        Console.WriteLine(string.Join(", ", hValsResult));
        // >>> Hello, World

code:
hValsResult1, err := rdb.HSet(ctx, "myhash",
		"field1", "Hello",
		"field2", "World",
	).Result()

	if err != nil {
		panic(err)
	}

	fmt.Println(hValsResult1) // >>> 2

	hValsResult2, err := rdb.HVals(ctx, "myhash").Result()

	if err != nil {
		panic(err)
	}

	sort.Strings(hValsResult2)

	fmt.Println(hValsResult2) // >>> [Hello World]

code:
Map<String, String> hValsExampleParams = new HashMap<>();
            hValsExampleParams.put("field1", "Hello");
            hValsExampleParams.put("field2", "World");

            CompletableFuture<Void> hValsExample = asyncCommands.hset("myhash", hValsExampleParams).thenCompose(res1 -> {
                return asyncCommands.hvals("myhash");
            }).thenAccept(res2 -> {
                List<String> sortedValues = new ArrayList<>(res2);
                Collections.sort(sortedValues);
                System.out.println(sortedValues);
                // >>> [Hello, World]
            }).toCompletableFuture();

code:
Map<String, String> hValsExampleParams = new HashMap<>();
            hValsExampleParams.put("field1", "Hello");
            hValsExampleParams.put("field2", "World");

            Mono<Long> hValsExample1 = reactiveCommands.hset("myhash", hValsExampleParams).doOnNext(result -> {
            });

            hValsExample1.block();

            Mono<List<String>> hValsExample2 = reactiveCommands.hvals("myhash").collectList().doOnNext(result -> {
                List<String> sortedValues = new ArrayList<>(result);
                Collections.sort(sortedValues);
                System.out.println(sortedValues);
                // >>> [Hello, World]
            });

code:
Map<String, String> hValsExampleParams = new HashMap<>();
        hValsExampleParams.put("field1", "Hello");
        hValsExampleParams.put("field2", "World");

        long hValsResult1 = jedis.hset("myhash", hValsExampleParams);
        System.out.println(hValsResult1); // >>> 2

        List<String> hValsResult2 = jedis.hvals("myhash");
        Collections.sort(hValsResult2);
        System.out.println(hValsResult2);
        // >>> [Hello, World]

code:
const res12 = await client.hSet(
  'myhash',
  {
    'field1': 'Hello',
    'field2': 'World'
  }
)

const res13 = await client.hVals('myhash')
console.log(res13) // [ 'Hello', 'World' ]

code:
$hValsResult1 = $this->redis->hmset('myhash', ['field1' => 'Hello', 'field2' => 'World']);
        echo "HMSET myhash field1 Hello field2 World: " . ($hValsResult1 ? 'OK' : 'FAIL') . "\n"; // >>> OK

        $hValsResult2 = $this->redis->hvals('myhash');
        echo "HVALS myhash: " . json_encode($hValsResult2) . "\n"; // >>> ["Hello","World"]

code:
res10 = r.hset("myhash", mapping={"field1": "Hello", "field2": "World"})

res11 = r.hvals("myhash")
print(res11) # >>> [ "Hello", "World" ]

code:
let hash_fields = [
            ("field1", "Hello"),
            ("field2", "World"),
        ];

        if let Ok(_) = r.hset_multiple::<&str, &str, &str, String>("myhash", &hash_fields).await {
            // Fields set successfully
        }

        match r.hvals("myhash").await {
            Ok(res11) => {
                let res11: Vec<String> = res11;
                println!("{res11:?}");    // >>> ["Hello", "World"]
            },
            Err(e) => {
                println!("Error getting hash values: {e}");
                return;
            }
        }

code:
let hash_fields = [
            ("field1", "Hello"),
            ("field2", "World"),
        ];

        if let Ok(_) = r.hset_multiple::<&str, &str, &str, String>("myhash", &hash_fields) {
            // Fields set successfully
        }

        match r.hvals("myhash") {
            Ok(res11) => {
                let res11: Vec<String> = res11;
                println!("{res11:?}");    // >>> ["Hello", "World"]
            },
            Err(e) => {
                println!("Error getting hash values: {e}");
                return;
            }
        }


title: INCR

summary: Increments the integer value of a key by one. Uses 0 as initial value if the key doesn't exist.

title: Examples

text:
#### Code Examples

Foundational: Increment the integer value of a key by one using INCR (initializes to 0 if key doesn't exist)

**Difficulty:** Beginner

**Commands:** SET, INCR, GET

**Complexity:**
- SET: O(1)
- INCR: O(1)
- GET: O(1)

**Redis CLI:**

[code example]

**Available in:** Redis CLI, C, C# (Synchronous), Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), JavaScript (Node.js), PHP, Python, Rust (Asynchronous), Rust (Synchronous)

**C:**

[code example]

**C# (Synchronous):**

[code example]

**Go:**

[code example]

**Java (Asynchronous - Lettuce):**

[code example]

**Java (Reactive - Lettuce):**

[code example]

**Java (Synchronous - Jedis):**

[code example]

**JavaScript (Node.js):**

[code example]

**JavaScript (Node.js):**

[code example]

**JavaScript (Node.js):**

[code example]

**JavaScript (Node.js):**

[code example]

**PHP:**

[code example]

**Python:**

[code example]

**Rust (Asynchronous):**

[code example]

**Rust (Synchronous):**

[code example]

Give this command a try in the interactive console:

SET mykey "10"
INCR mykey
GET mykey

title: Pattern: Counter

text:
The counter pattern is the most obvious thing you can do with Redis atomic
increment operations.
The idea is simply send an `INCR` command to Redis every time an operation
occurs.
For instance in a web application we may want to know how many page views this
user did every day of the year.

To do so the web application may simply increment a key every time the user
performs a page view, creating the key name concatenating the User ID and a
string representing the current date.

This simple pattern can be extended in many ways:

* It is possible to use `INCR` and [`EXPIRE`]() together at every page view to have
  a counter counting only the latest N page views separated by less than the
  specified amount of seconds.
* A client may use GETSET in order to atomically get the current counter value
  and reset it to zero.
* Using other atomic increment/decrement commands like [`DECR`]() or [`INCRBY`]() it
  is possible to handle values that may get bigger or smaller depending on the
  operations performed by the user.
  Imagine for instance the score of different users in an online game.

title: Pattern: Rate limiter

text:
The rate limiter pattern is a special counter that is used to limit the rate at
which an operation can be performed.
The classical materialization of this pattern involves limiting the number of
requests that can be performed against a public API.

We provide two implementations of this pattern using `INCR`, where we assume
that the problem to solve is limiting the number of API calls to a maximum of
_ten requests per second per IP address_.

title: Pattern: Rate limiter 1

text:
The more simple and direct implementation of this pattern is the following:

[code example]

Basically we have a counter for every IP, for every different second.
But these counters are always incremented setting an expire of 10 seconds so that
they'll be removed by Redis automatically when the current second is a different
one.

Note the used of [`MULTI`]() and [`EXEC`]() in order to make sure that we'll both
increment and set the expire at every API call.

title: Pattern: Rate limiter 2

text:
An alternative implementation uses a single counter, but is a bit more complex
to get it right without race conditions.
We'll examine different variants.

[code example]

The counter is created in a way that it only will survive one second, starting
from the first request performed in the current second.
If there are more than 10 requests in the same second the counter will reach a
value greater than 10, otherwise it will expire and start again from 0.

**In the above code there is a race condition**.
If for some reason the client performs the `INCR` command but does not perform
the [`EXPIRE`]() the key will be leaked until we'll see the same IP address again.

This can be easily fixed by turning the `INCR` with optional [`EXPIRE`]() into a Lua
script that is then sent using the [`EVAL`]() command (only available since Redis version
2.6).

[code example]

There is a different way to fix this issue without using scripting, by using
Redis lists instead of counters.
The implementation is more complex and uses more advanced features but has the
advantage of remembering the IP addresses of the clients currently performing an
API call, that may be useful or not depending on the application.

[code example]

The [`RPUSHX`]() command only pushes the element if the key already exists.

Note that we have a race here, but it is not a problem: [`EXISTS`]() may return
false but the key may be created by another client before we create it inside
the [`MULTI`]() / [`EXEC`]() block.
However this race will just miss an API call under rare conditions, so the rate
limiting will still work correctly.

title: Return information

text:
**RESP2:**

[Integer reply](../../develop/reference/protocol-spec#integers): the value of the key after the increment.

**RESP3:**

[Integer reply](../../develop/reference/protocol-spec#integers): the value of the key after the increment.

code:
> SET mykey "10"
"OK"
> INCR mykey
(integer) 11
> GET mykey
"11"

code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <hiredis/hiredis.h>

int main(int argc, char **argv) {
    redisContext *c = redisConnect("127.0.0.1", 6379);

    if (c == NULL || c->err) {
        if (c) {
            printf("Connection error: %s\n", c->errstr);
            redisFree(c);
        } else {
            printf("Connection error: can't allocate redis context\n");
        }
        return 1;
    }

    redisReply *reply = redisCommand(c, "SET key1 Hello");
    freeReplyObject(reply);

    reply = redisCommand(c, "SET key2 World");
    freeReplyObject(reply);

    reply = redisCommand(c, "MGET key1 key2 nonexisting");

    for (size_t i = 0; i < reply->elements; i++) {
        if (i > 0) {
            printf(", ");
        }

        if (reply->element[i]->type == REDIS_REPLY_NIL) {
            printf("null");
        } else {
            printf("%s", reply->element[i]->str);
        }
    }
    printf("\n");
    // >>> Hello, World, null

    freeReplyObject(reply);
    redisReply *cleanup2 = redisCommand(c, "DEL key1 key2 nonexisting");
    freeReplyObject(cleanup2);

    redisFree(c);

    return 0;
}

code:
bool incrResult1 = db.StringSet("mykey", "10");
        Console.WriteLine(incrResult1); // >>> true

        long incrResult2 = db.StringIncrement("mykey");
        Console.WriteLine(incrResult2); // >>> 11

        RedisValue incrResult3 = db.StringGet("mykey");
        Console.WriteLine(incrResult3); // >>> 11

code:
incrResult1, err := rdb.Set(ctx, "mykey", "10", 0).Result()

	if err != nil {
		panic(err)
	}

	fmt.Println(incrResult1) // >>> OK

	incrResult2, err := rdb.Incr(ctx, "mykey").Result()

	if err != nil {
		panic(err)
	}

	fmt.Println(incrResult2) // >>> 11

	incrResult3, err := rdb.Get(ctx, "mykey").Result()

	if err != nil {
		panic(err)
	}

	fmt.Println(incrResult3) // >>> 11

code:
package io.redis.examples.async;

import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.async.RedisAsyncCommands;

import java.util.concurrent.CompletableFuture;

public class CmdsStringExample {

    public void run() {
        RedisClient redisClient = RedisClient.create("redis://localhost:6379");

        try (StatefulRedisConnection<String, String> connection = redisClient.connect()) {
            RedisAsyncCommands<String, String> asyncCommands = connection.async();

            CompletableFuture<Void> mgetExample = asyncCommands.set("key1", "Hello")
                    .thenCompose(res1 -> asyncCommands.set("key2", "World"))
                    .thenCompose(res2 -> asyncCommands.mget("key1", "key2", "nonexisting"))
                    .thenAccept(res3 -> {
                        System.out.println(res3);
                        // >>> [KeyValue[key1, Hello], KeyValue[key2, World], KeyValue[nonexisting, null]]
                    })
                    .toCompletableFuture();

            mgetExample.join();
        } finally {
            redisClient.shutdown();
        }
    }
}

code:
package io.redis.examples.reactive;

import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.reactive.RedisReactiveCommands;

import reactor.core.publisher.Mono;

public class CmdsStringExample {

    public void run() {
        RedisClient redisClient = RedisClient.create("redis://localhost:6379");

        try (StatefulRedisConnection<String, String> connection = redisClient.connect()) {
            RedisReactiveCommands<String, String> reactiveCommands = connection.reactive();

            Mono<Void> mgetExample = reactiveCommands.set("key1", "Hello")
                    .flatMap(res1 -> reactiveCommands.set("key2", "World"))
                    .flatMap(res2 -> reactiveCommands.mget("key1", "key2", "nonexisting").collectList())
                    .doOnNext(res3 -> {
                        System.out.println(res3);
                        // >>> [KeyValue[key1, Hello], KeyValue[key2, World], KeyValue[nonexisting, null]]
                    })
                    .then();

            mgetExample.block();
        } finally {
            redisClient.shutdown();
        }
    }
}

code:
String incrResult1 = jedis.set("mykey", "10");
        System.out.println(incrResult1);    // >>> OK

        long incrResult2 = jedis.incr("mykey");
        System.out.println(incrResult2);    // >>> 11

        String incrResult3 = jedis.get("mykey");
        System.out.println(incrResult3);    // >>> 11

code:
import assert from 'node:assert';
import { createClient } from 'redis';

const client = createClient();
await client.connect().catch(console.error);

await client.set('key1', 'Hello');
await client.set('key2', 'World');

const mgetResult = await client.mGet(['key1', 'key2', 'nonexisting']);
console.log(mgetResult); // >>> [ 'Hello', 'World', null ]

await client.close();

code:
import assert from 'node:assert';
import { Redis } from 'ioredis';

const redis = new Redis();

await redis.set('key1', 'Hello');
await redis.set('key2', 'World');

const mgetResult = await redis.mget('key1', 'key2', 'nonexisting');
console.log(mgetResult); // >>> ['Hello', 'World', null]

redis.disconnect();

code:
<?php
use PHPUnit\Framework\TestCase;
use Predis\Client as PredisClient;

class CmdsStringTest
{
    public function testCmdsString() {
        $r = new PredisClient([
            'scheme'   => 'tcp',
            'host'     => '127.0.0.1',
            'port'     => 6379,
            'password' => '',
            'database' => 0,
        ]);

        $r->set('key1', 'Hello');
        $r->set('key2', 'World');

        $mgetResult = $r->mget(['key1', 'key2', 'nonexisting']);
        echo json_encode($mgetResult) . PHP_EOL; // >>> ["Hello","World",null]

    }
}

code:
import redis

r = redis.Redis(decode_responses=True)

r.set("key1", "Hello")
r.set("key2", "World")

mget_result = r.mget("key1", "key2", "nonexisting")
print(mget_result)
# >>> ['Hello', 'World', None]

code:
mod cmds_string_tests {
    use redis::AsyncCommands;

    async fn run() {
        let mut r = match redis::Client::open("redis://127.0.0.1") {
            Ok(client) => match client.get_multiplexed_async_connection().await {
                Ok(conn) => conn,
                Err(e) => {
                    println!("Failed to connect to Redis: {e}");
                    return;
                }
            },
            Err(e) => {
                println!("Failed to create Redis client: {e}");
                return;
            }
        };

        if let Ok(res) = r.set("key1", "Hello").await {
            let _: String = res;
        }

        if let Ok(res) = r.set("key2", "World").await {
            let _: String = res;
        }

        match r.mget(&["key1", "key2", "nonexisting"]).await {
            Ok(mget_result) => {
                let mget_result: Vec<Option<String>> = mget_result;
                println!("{mget_result:?}");    // >>> [Some("Hello"), Some("World"), None]
            }
            Err(e) => {
                println!("Error getting values: {e}");
            }
        }

    }
}

code:
mod cmds_string_tests {
    use redis::Commands;

    fn run() {
        let mut r = match redis::Client::open("redis://127.0.0.1") {
            Ok(client) => match client.get_connection() {
                Ok(conn) => conn,
                Err(e) => {
                    println!("Failed to connect to Redis: {e}");
                    return;
                }
            },
            Err(e) => {
                println!("Failed to create Redis client: {e}");
                return;
            }
        };

        if let Ok(res) = r.set("key1", "Hello") {
            let _: String = res;
        }

        if let Ok(res) = r.set("key2", "World") {
            let _: String = res;
        }

        match r.mget(&["key1", "key2", "nonexisting"]) {
            Ok(mget_result) => {
                let mget_result: Vec<Option<String>> = mget_result;
                println!("{mget_result:?}");    // >>> [Some("Hello"), Some("World"), None]
            }
            Err(e) => {
                println!("Error getting values: {e}");
            }
        }

    }
}

code:
FUNCTION LIMIT_API_CALL(ip)
ts = CURRENT_UNIX_TIME()
keyname = ip+":"+ts
MULTI
    INCR(keyname)
    EXPIRE(keyname,10)
EXEC
current = RESPONSE_OF_INCR_WITHIN_MULTI
IF current > 10 THEN
    ERROR "too many requests per second"
ELSE
    PERFORM_API_CALL()
END

code:
FUNCTION LIMIT_API_CALL(ip):
current = GET(ip)
IF current != NULL AND current > 10 THEN
    ERROR "too many requests per second"
ELSE
    value = INCR(ip)
    IF value == 1 THEN
        EXPIRE(ip,1)
    END
    PERFORM_API_CALL()
END

code:
local current
current = redis.call("incr",KEYS[1])
if current == 1 then
    redis.call("expire",KEYS[1],1)
end

code:
FUNCTION LIMIT_API_CALL(ip)
current = LLEN(ip)
IF current > 10 THEN
    ERROR "too many requests per second"
ELSE
    IF EXISTS(ip) == FALSE
        MULTI
            RPUSH(ip,ip)
            EXPIRE(ip,1)
        EXEC
    ELSE
        RPUSHX(ip,ip)
    END
    PERFORM_API_CALL()
END


title: INCRBY

summary: Increments the integer value of a key by a number. Uses 0 as initial value if the key doesn't exist.

title: Overview

text:
Increments the number stored at `key` by `increment`.
If the key does not exist, it is set to `0` before performing the operation.
An error is returned if the key contains a value of the wrong type or contains a
string that can not be represented as integer.
This operation is limited to 64 bit signed integers.

See [`INCR`]() for extra information on increment/decrement operations.

title: Examples

text:
SET mykey "10"
INCRBY mykey 5

text:
| Redis
Software | Redis
Cloud | Notes |
|:----------------------|:-----------------|:------|
| ✅ Standard
<nobr>✅ Active-Active</nobr> | ✅ Standard
<nobr>✅ Active-Active</nobr> |  |

title: Return information


title: INCRBYFLOAT

summary: Increment the floating point value of a key by a number. Uses 0 as initial value if the key doesn't exist.

title: Overview

text:
Increment the string representing a floating point number stored at `key` by the
specified `increment`. By using a negative `increment` value, the result is
that the value stored at the key is decremented (by the obvious properties
of addition).
If the key does not exist, it is set to `0` before performing the operation.
An error is returned if one of the following conditions occur:

* The key contains a value of the wrong type (not a string).
* The current key content or the specified increment are not parsable as a
  double precision floating point number.

If the command is successful the new incremented value is stored as the new
value of the key (replacing the old one), and returned to the caller as a
string.

Both the value already contained in the string key and the increment argument
can be optionally provided in exponential notation, however the value computed
after the increment is stored consistently in the same format, that is, an
integer number followed (if needed) by a dot, and a variable number of digits
representing the decimal part of the number.
Trailing zeroes are always removed.

The precision of the output is fixed at 17 digits after the decimal point
regardless of the actual internal precision of the computation.

title: Examples

text:
SET mykey 10.50
INCRBYFLOAT mykey 0.1
INCRBYFLOAT mykey -5
SET mykey 5.0e3
INCRBYFLOAT mykey 2.0e2

title: Implementation details

text:
The command is always propagated in the replication link and the Append Only
File as a [`SET`]() operation, so that differences in the underlying floating point
math implementation will not be sources of inconsistency.

title: Return information

text:
**RESP2:**

[Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): the value of the key after the increment.

**RESP3:**

[Bulk string reply](../../develop/reference/protocol-spec#bulk-strings): the value of the key after the increment.


title: Commands

summary: Complete list of all Redis commands available in version 8.6, organized by functional group

title: Redis 8.6 Commands Reference

summary: Complete list of all Redis commands available in version 8.4, organized by functional group

title: Redis 8.4 Commands Reference

summary: Complete list of all Redis commands available in version 8.2, organized by functional group

title: Redis 8.2 Commands Reference

summary: Complete list of all Redis commands available in version 8.0, organized by functional group

title: Redis 8.0 Commands Reference

summary: Complete list of all Redis commands available in version 7.4, organized by functional group

title: Redis 7.4 Commands Reference

summary: Complete list of all Redis commands available in version 7.2, organized by functional group

title: Redis 7.2 Commands Reference

summary: Complete list of all Redis commands available in version 6.2, organized by functional group

title: Redis 6.2 Commands Reference

summary: A container for Access List Control commands.

title: ACL

summary: Lists the ACL categories, or the commands inside a category.

title: ACL CAT

summary: Deletes ACL users, and terminates their connections.

title: ACL DELUSER

summary: Simulates the execution of a command by a user, without executing the command.

title: ACL DRYRUN

summary: Generates a pseudorandom, secure password that can be used to identify ACL users.

title: ACL GENPASS

summary: Lists the ACL rules of a user.

title: ACL GETUSER

summary: Returns helpful text about the different subcommands.

title: ACL HELP

summary: Dumps the effective rules in ACL file format.

title: ACL LIST

summary: Reloads the rules from the configured ACL file.

title: ACL LOAD

summary: Lists recent security events generated due to ACL rules.

title: ACL LOG

summary: Saves the effective ACL rules in the configured ACL file.

title: ACL SAVE

summary: Creates and modifies an ACL user and its rules.

title: ACL SETUSER

summary: Lists all ACL users.

title: ACL USERS

summary: Returns the authenticated username of the current connection.

title: ACL WHOAMI

summary: Appends a string to the value of a key. Creates the key if it doesn't exist.

title: APPEND

summary: Signals that a cluster client is following an -ASK redirect.

title: ASKING

summary: Authenticates the connection.

title: AUTH

summary: Adds an item to a Bloom Filter

title: BF.ADD

summary: Returns the cardinality of a Bloom filter

title: BF.CARD

summary: Checks whether an item exists in a Bloom Filter

title: BF.EXISTS

summary: Returns information about a Bloom Filter

title: BF.INFO

summary: Adds one or more items to a Bloom Filter. A filter will be created if it does not exist

title: BF.INSERT

summary: Restores a filter previously saved using SCANDUMP

title: BF.LOADCHUNK

title: BF.MADD

summary: Checks whether one or more items exist in a Bloom Filter

title: BF.MEXISTS

summary: Creates a new Bloom Filter

title: BF.RESERVE

summary: Begins an incremental save of the bloom filter

title: BF.SCANDUMP

summary: Asynchronously rewrites the append-only file to disk.

title: BGREWRITEAOF

summary: Asynchronously saves the database(s) to disk.

title: BGSAVE

summary: Counts the number of set bits (population counting) in a string.

title: BITCOUNT

summary: Performs arbitrary bitfield integer operations on strings.

title: BITFIELD

summary: Performs arbitrary read-only bitfield integer operations on strings.

title: BITFIELD_RO

summary: Performs bitwise operations on multiple strings, and stores the result.

title: BITOP

summary: Finds the first set (1) or clear (0) bit in a string.

title: BITPOS

summary: Pops an element from a list, pushes it to another list and returns it. Blocks until an element is available otherwise. Deletes the list if the last element was moved.

title: BLMOVE

summary: Pops the first element from one of multiple lists. Blocks until an element is available otherwise. Deletes the list if the last element was popped.

title: BLMPOP

summary: Removes and returns the first element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped.

title: BLPOP

summary: Removes and returns the last element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped.

title: BRPOP

summary: Pops an element from a list, pushes it to another list and returns it. Block until an element is available otherwise. Deletes the list if the last element was popped.

title: BRPOPLPUSH

summary: Removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.

title: BZMPOP

summary: Removes and returns the member with the highest score from one or more sorted sets. Blocks until a member available otherwise. Deletes the sorted set if the last element was popped.

title: BZPOPMAX

summary: Removes and returns the member with the lowest score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.

title: BZPOPMIN

summary: Adds an item to a Cuckoo Filter

title: CF.ADD

summary: Adds an item to a Cuckoo Filter if the item did not exist previously.

title: CF.ADDNX

summary: Return the number of times an item might be in a Cuckoo Filter

title: CF.COUNT

summary: Deletes an item from a Cuckoo Filter

title: CF.DEL

summary: Checks whether one or more items exist in a Cuckoo Filter

title: CF.EXISTS

summary: Returns information about a Cuckoo Filter

title: CF.INFO

summary: Adds one or more items to a Cuckoo Filter. A filter will be created if it does not exist

title: CF.INSERT

summary: Adds one or more items to a Cuckoo Filter if the items did not exist previously. A filter will be created if it does not exist

title: CF.INSERTNX

title: CF.LOADCHUNK

title: CF.MEXISTS

summary: Creates a new Cuckoo Filter

title: CF.RESERVE

title: CF.SCANDUMP

summary: A container for client connection commands.

title: CLIENT

summary: Instructs the server whether to track the keys in the next request.

title: CLIENT CACHING

summary: Returns the name of the connection.

title: CLIENT GETNAME

summary: Returns the client ID to which the connection's tracking notifications are redirected.

title: CLIENT GETREDIR

title: CLIENT HELP

summary: Returns the unique client ID of the connection.

title: CLIENT ID

summary: Returns information about the connection.

title: CLIENT INFO

summary: Terminates open connections.

title: CLIENT KILL

summary: Lists open connections.

title: CLIENT LIST

summary: Sets the client eviction mode of the connection.

title: CLIENT NO-EVICT

summary: Controls whether commands sent by the client affect the LRU/LFU of accessed keys.

title: CLIENT NO-TOUCH

summary: Suspends commands processing.

title: CLIENT PAUSE

summary: Instructs the server whether to reply to commands.

title: CLIENT REPLY

summary: Sets information specific to the client or connection.

title: CLIENT SETINFO

summary: Sets the connection name.

title: CLIENT SETNAME

summary: Controls server-assisted client-side caching for the connection.

title: CLIENT TRACKING

summary: Returns information about server-assisted client-side caching for the connection.

title: CLIENT TRACKINGINFO

summary: Unblocks a client blocked by a blocking command from a different connection.

title: CLIENT UNBLOCK

summary: Resumes processing commands from paused clients.

title: CLIENT UNPAUSE

summary: A container for Redis Cluster commands.

title: CLUSTER

summary: Assigns new hash slots to a node.

title: CLUSTER ADDSLOTS

summary: Assigns new hash slot ranges to a node.

title: CLUSTER ADDSLOTSRANGE

summary: Advances the cluster config epoch.

title: CLUSTER BUMPEPOCH

summary: Returns the number of active failure reports active for a node.

title: CLUSTER COUNT-FAILURE-REPORTS

summary: Returns the number of keys in a hash slot.

title: CLUSTER COUNTKEYSINSLOT

summary: Sets hash slots as unbound for a node.

title: CLUSTER DELSLOTS

summary: Sets hash slot ranges as unbound for a node.

title: CLUSTER DELSLOTSRANGE

summary: Forces a replica to perform a manual failover of its master.

title: CLUSTER FAILOVER

summary: Deletes all slots information from a node.

title: CLUSTER FLUSHSLOTS

summary: Removes a node from the nodes table.

title: CLUSTER FORGET

summary: Returns the key names in a hash slot.

title: CLUSTER GETKEYSINSLOT

title: CLUSTER HELP

summary: Returns information about the state of a node.

title: CLUSTER INFO

summary: Returns the hash slot for a key.

title: CLUSTER KEYSLOT

summary: Returns a list of all TCP links to and from peer nodes.

title: CLUSTER LINKS

summary: Forces a node to handshake with another node.

title: CLUSTER MEET

summary: Start, monitor, and cancel atomic slot migration tasks.

title: CLUSTER MIGRATION

summary: Returns the ID of a node.

title: CLUSTER MYID

summary: Returns the shard ID of a node.

title: CLUSTER MYSHARDID

summary: Returns the cluster configuration for a node.

title: CLUSTER NODES

summary: Lists the replica nodes of a master node.

title: CLUSTER REPLICAS

summary: Configure a node as replica of a master node.

title: CLUSTER REPLICATE

summary: Resets a node.

title: CLUSTER RESET

summary: Forces a node to save the cluster configuration to disk.

title: CLUSTER SAVECONFIG

summary: Sets the configuration epoch for a new node.

title: CLUSTER SET-CONFIG-EPOCH

summary: Binds a hash slot to a node.

title: CLUSTER SETSLOT

summary: Returns the mapping of cluster slots to shards.

title: CLUSTER SHARDS

title: CLUSTER SLAVES

summary: Return an array of slot usage statistics for slots assigned to the current node.

title: CLUSTER SLOT-STATS

summary: Returns the mapping of cluster slots to nodes.

title: CLUSTER SLOTS

summary: Increases the count of one or more items by increment

title: CMS.INCRBY

summary: Returns information about a sketch

title: CMS.INFO

summary: Initializes a Count-Min Sketch to dimensions specified by user

title: CMS.INITBYDIM

summary: Initializes a Count-Min Sketch to accommodate requested tolerances.

title: CMS.INITBYPROB

summary: Merges several sketches into one sketch

title: CMS.MERGE

summary: Returns the count for one or more items in a sketch

title: CMS.QUERY

summary: Returns detailed information about all commands.

title: COMMAND

summary: Returns a count of commands.

title: COMMAND COUNT

summary: Returns documentary information about one, multiple or all commands.

title: COMMAND DOCS

summary: Extracts the key names from an arbitrary command.

title: COMMAND GETKEYS

summary: Extracts the key names and access flags for an arbitrary command.

title: COMMAND GETKEYSANDFLAGS

title: COMMAND HELP

summary: Returns information about one, multiple or all commands.

title: COMMAND INFO

summary: Returns a list of command names.

title: COMMAND LIST

summary: A container for server configuration commands.

title: CONFIG

summary: Returns the effective values of configuration parameters.

title: CONFIG GET

title: CONFIG HELP

summary: Resets the server's statistics.

title: CONFIG RESETSTAT

summary: Persists the effective configuration to file.

title: CONFIG REWRITE

summary: Sets configuration parameters in-flight.

title: CONFIG SET

summary: Copies the value of a key to a new key.

title: COPY

summary: Returns the number of keys in the database.

title: DBSIZE

summary: A container for debugging commands.

title: DEBUG

summary: Decrements the integer value of a key by one. Uses 0 as initial value if the key doesn't exist.

title: DECR

summary: Decrements a number from the integer value of a key. Uses 0 as initial value if the key doesn't exist.

title: DECRBY

summary: Deletes one or more keys.

title: DEL

summary: Conditionally removes the specified key based on value or hash digest comparison.

title: DELEX

summary: Returns the hash digest of a string value.

title: DIGEST

summary: Discards a transaction.

title: DISCARD

summary: Returns a serialized representation of the value stored at a key.

title: DUMP

summary: Returns the given string.

title: ECHO

summary: Executes a server-side Lua script.

title: EVAL

summary: Executes a read-only server-side Lua script.

title: EVAL_RO

summary: Executes a server-side Lua script by SHA1 digest.

title: EVALSHA

summary: Executes a read-only server-side Lua script by SHA1 digest.

title: EVALSHA_RO

summary: Executes all commands in a transaction.

title: EXEC

summary: Determines whether one or more keys exist.

title: EXISTS

summary: Sets the expiration time of a key in seconds.

title: EXPIRE

summary: Sets the expiration time of a key to a Unix timestamp.

title: EXPIREAT

summary: Returns the expiration time of a key as a Unix timestamp.

title: EXPIRETIME

summary: Starts a coordinated failover from a server to one of its replicas.

title: FAILOVER

summary: Invokes a function.

title: FCALL

summary: Invokes a read-only function.

title: FCALL_RO

summary: Removes all keys from all databases.

title: FLUSHALL

summary: Remove all keys from the current database.

title: FLUSHDB

summary: Returns a list of all existing indexes

title: FT._LIST

summary: Run a search query on an index and perform aggregate transformations on the results

title: FT.AGGREGATE

summary: Adds an alias to the index

title: FT.ALIASADD

summary: Deletes an alias from the index

title: FT.ALIASDEL

summary: Adds or updates an alias to the index

title: FT.ALIASUPDATE

summary: Adds a new field to the index

title: FT.ALTER

summary: Retrieves runtime configuration options

title: FT.CONFIG GET

summary: Help description of runtime configuration options

title: FT.CONFIG HELP

summary: Sets runtime configuration options

title: FT.CONFIG SET

summary: Creates an index with the given spec

title: FT.CREATE

summary: Deletes a cursor

title: FT.CURSOR DEL

summary: Reads from a cursor

title: FT.CURSOR READ

summary: Adds terms to a dictionary

title: FT.DICTADD

summary: Deletes terms from a dictionary

title: FT.DICTDEL

summary: Dumps all terms in the given dictionary

title: FT.DICTDUMP

summary: Deletes the index

title: FT.DROPINDEX

summary: Returns the execution plan for a complex query

title: FT.EXPLAIN

title: FT.EXPLAINCLI

summary: Performs hybrid search combining text search and vector similarity search

title: FT.HYBRID

summary: Returns information and statistics on the index

title: FT.INFO

summary: Performs a `FT.SEARCH` or `FT.AGGREGATE` command and collects performance information

title: FT.PROFILE

summary: Searches the index with a textual query, returning either documents or just ids

title: FT.SEARCH

summary: Performs spelling correction on a query, returning suggestions for misspelled terms

title: FT.SPELLCHECK

summary: Adds a suggestion string to an auto-complete suggestion dictionary

title: FT.SUGADD

summary: Deletes a string from a suggestion index

title: FT.SUGDEL

summary: Gets completion suggestions for a prefix

title: FT.SUGGET

summary: Gets the size of an auto-complete suggestion dictionary

title: FT.SUGLEN

summary: Dumps the contents of a synonym group

title: FT.SYNDUMP

summary: Creates or updates a synonym group with additional terms

title: FT.SYNUPDATE

summary: Returns the distinct tags indexed in a Tag field

title: FT.TAGVALS

summary: A container for function commands.

title: FUNCTION

summary: Deletes a library and its functions.

title: FUNCTION DELETE

summary: Dumps all libraries into a serialized binary payload.

title: FUNCTION DUMP

summary: Deletes all libraries and functions.

title: FUNCTION FLUSH

title: FUNCTION HELP

summary: Terminates a function during execution.

title: FUNCTION KILL

summary: Returns information about all libraries.

title: FUNCTION LIST

summary: Creates a library.

title: FUNCTION LOAD

summary: Restores all libraries from a payload.

title: FUNCTION RESTORE

summary: Returns information about a function during execution.

title: FUNCTION STATS

summary: Adds one or more members to a geospatial index. The key is created if it doesn't exist.

title: GEOADD

summary: Returns the distance between two members of a geospatial index.

title: GEODIST

summary: Returns members from a geospatial index as geohash strings.

title: GEOHASH

summary: Returns the longitude and latitude of members from a geospatial index.

title: GEOPOS

summary: Queries a geospatial index for members within a distance from a coordinate, optionally stores the result.

title: GEORADIUS

summary: Returns members from a geospatial index that are within a distance from a coordinate.

title: GEORADIUS_RO

summary: Queries a geospatial index for members within a distance from a member, optionally stores the result.

title: GEORADIUSBYMEMBER

summary: Returns members from a geospatial index that are within a distance from a member.

title: GEORADIUSBYMEMBER_RO

summary: Queries a geospatial index for members inside an area of a box or a circle.

title: GEOSEARCH

summary: Queries a geospatial index for members inside an area of a box or a circle, optionally stores the result.

title: GEOSEARCHSTORE

summary: Returns the string value of a key.

title: GET

summary: Returns a bit value by offset.

title: GETBIT

summary: Returns the string value of a key after deleting the key.

title: GETDEL

summary: Returns the string value of a key after setting its expiration time.

title: GETEX

summary: Returns a substring of the string stored at a key.

title: GETRANGE

summary: Returns the previous string value of a key after setting it to a new value.

title: GETSET

summary: Deletes one or more fields and their values from a hash. Deletes the hash if no fields remain.

title: HDEL

summary: Handshakes with the Redis server.

title: HELLO

summary: Determines whether a field exists in a hash.

title: HEXISTS

summary: Set expiration for hash fields using relative time to expire (seconds)

title: HEXPIRE

summary: Set expiration for hash fields using an absolute Unix timestamp (seconds)

title: HEXPIREAT

summary: Returns the expiration time of a hash field as a Unix timestamp, in seconds.

title: HEXPIRETIME

summary: Returns the value of a field in a hash.

title: HGET

summary: Returns all fields and values in a hash.

title: HGETALL

summary: Returns the value of a field and deletes it from the hash.

title: HGETDEL

summary: Get the value of one or more fields of a given hash key, and optionally set their expiration.

title: HGETEX

summary: Increments the integer value of a field in a hash by a number. Uses 0 as initial value if the field doesn't exist.

title: HINCRBY

summary: Increments the floating point value of a field by a number. Uses 0 as initial value if the field doesn't exist.

title: HINCRBYFLOAT

summary: Returns all fields in a hash.

title: HKEYS

summary: Returns the number of fields in a hash.

title: HLEN

summary: Returns the values of all fields in a hash.

title: HMGET

summary: Sets the values of multiple fields.

title: HMSET

summary: A container for hotkeys tracking commands.

title: HOTKEYS

summary: Returns lists of top K hotkeys depending on metrics chosen in HOTKEYS START command.

title: HOTKEYS GET

summary: Returns helpful text about HOTKEYS commands and parameters.

title: HOTKEYS HELP

summary: Release the resources used for hotkey tracking.

title: HOTKEYS RESET

summary: Starts hotkeys tracking.

title: HOTKEYS START

summary: Stops hotkeys tracking.

title: HOTKEYS STOP

summary: Removes the expiration time for each specified field

title: HPERSIST

summary: Set expiration for hash fields using relative time to expire (milliseconds)

title: HPEXPIRE

summary: Set expiration for hash fields using an absolute Unix timestamp (milliseconds)

title: HPEXPIREAT

summary: Returns the expiration time of a hash field as a Unix timestamp, in msec.

title: HPEXPIRETIME

summary: Returns the TTL in milliseconds of a hash field.

title: HPTTL

summary: Returns one or more random fields from a hash.

title: HRANDFIELD

summary: Iterates over fields and values of a hash.

title: HSCAN

title: HSET

title: HSETEX

title: HSETNX

title: HSTRLEN

title: HTTL

summary: Returns all values in a hash.

title: HVALS

title: INCR

title: INCRBY

title: INCRBYFLOAT

summary: Returns information and statistics about the server.

title: INFO

summary: Append one or more JSON values into the array at path after the last element in it.

title: JSON.ARRAPPEND

summary: Returns the index of the first occurrence of a JSON scalar value in the array at path

title: JSON.ARRINDEX

summary: Inserts the JSON scalar(s) value at the specified index in the array at path

title: JSON.ARRINSERT

summary: Returns the length of the array at path

title: JSON.ARRLEN

summary: Removes and returns the element at the specified index in the array at path

title: JSON.ARRPOP

summary: Trims the array at path to contain only the specified inclusive range of indices from start to stop

title: JSON.ARRTRIM

summary: Clears all values from an array or an object and sets numeric values to `0`

title: JSON.CLEAR

summary: Debugging container command

title: JSON.DEBUG

summary: Shows helpful information

title: JSON.DEBUG HELP

summary: Reports the size in bytes of a key

title: JSON.DEBUG MEMORY

summary: Deletes a value

title: JSON.DEL

summary: Deletes a value

title: JSON.FORGET

summary: Gets the value at one or more paths in JSON serialized form

title: JSON.GET

summary: Merges a given JSON value into matching paths. Consequently, JSON values at matching paths are updated, deleted, or expanded with new children

title: JSON.MERGE

summary: Returns the values at a path from one or more keys

title: JSON.MGET

summary: Sets or updates the JSON value of one or more keys

title: JSON.MSET

summary: Increments the numeric value at path by a value

title: JSON.NUMINCRBY

summary: Multiplies the numeric value at path by a value

title: JSON.NUMMULTBY

summary: Returns the JSON keys of the object at path

title: JSON.OBJKEYS

summary: Returns the number of keys of the object at path

title: JSON.OBJLEN

summary: Returns the JSON value at path in Redis Serialization Protocol (RESP)

title: JSON.RESP

summary: Sets or updates the JSON value at a path

title: JSON.SET

summary: Appends a string to a JSON string value at path

title: JSON.STRAPPEND

summary: Returns the length of the JSON String at path in key

title: JSON.STRLEN

summary: Toggles a boolean value

title: JSON.TOGGLE

summary: Returns the type of the JSON value at path

title: JSON.TYPE

summary: Returns all key names that match a pattern.

title: KEYS

summary: Returns the Unix timestamp of the last successful save to disk.

title: LASTSAVE

summary: A container for latency diagnostics commands.

title: LATENCY

summary: Returns a human-readable latency analysis report.

title: LATENCY DOCTOR

summary: Returns a latency graph for an event.

title: LATENCY GRAPH

title: LATENCY HELP

summary: Returns the cumulative distribution of latencies of a subset or all commands.

title: LATENCY HISTOGRAM

summary: Returns timestamp-latency samples for an event.

title: LATENCY HISTORY

summary: Returns the latest latency samples for all events.

title: LATENCY LATEST

summary: Resets the latency data for one or more events.

title: LATENCY RESET

summary: Finds the longest common substring.

title: LCS

summary: Returns an element from a list by its index.

title: LINDEX

summary: Inserts an element before or after another element in a list.

title: LINSERT

summary: Returns the length of a list.

title: LLEN

summary: Returns an element after popping it from one list and pushing it to another. Deletes the list if the last element was moved.

title: LMOVE

summary: Returns multiple elements from a list after removing them. Deletes the list if the last element was popped.

title: LMPOP

summary: Displays computer art and the Redis version

title: LOLWUT

summary: Returns the first elements in a list after removing it. Deletes the list if the last element was popped.

title: LPOP

summary: Returns the index of matching elements in a list.

title: LPOS

summary: Prepends one or more elements to a list. Creates the key if it doesn't exist.

title: LPUSH

summary: Prepends one or more elements to a list only when the list exists.

title: LPUSHX

summary: Returns a range of elements from a list.

title: LRANGE

summary: Removes elements from a list. Deletes the list if the last element was removed.

title: LREM

summary: Sets the value of an element in a list by its index.

title: LSET

summary: Removes elements from both ends a list. Deletes the list if all elements were trimmed.

title: LTRIM

summary: A container for memory diagnostics commands.

title: MEMORY

summary: Outputs a memory problems report.

title: MEMORY DOCTOR

title: MEMORY HELP

summary: Returns the allocator statistics.

title: MEMORY MALLOC-STATS

summary: Asks the allocator to release memory.

title: MEMORY PURGE

summary: Returns details about memory usage.

title: MEMORY STATS

summary: Estimates the memory usage of a key.

title: MEMORY USAGE

summary: Atomically returns the string values of one or more keys.

title: MGET

summary: Atomically transfers a key from one Redis instance to another.

title: MIGRATE

summary: A container for module commands.

title: MODULE

title: MODULE HELP

summary: Returns all loaded modules.

title: MODULE LIST

summary: Loads a module.

title: MODULE LOAD

summary: Loads a module using extended parameters.

title: MODULE LOADEX

summary: Unloads a module.

title: MODULE UNLOAD

summary: Listens for all requests received by the server in real-time.

title: MONITOR

summary: Moves a key to another database.

title: MOVE

summary: Atomically creates or modifies the string values of one or more keys.

title: MSET

summary: Atomically sets multiple string keys with a shared expiration in a single operation. Supports flexible argument parsing where condition and expiration flags can appear in any order.

title: MSETEX

summary: Atomically modifies the string values of one or more keys only when all keys don't exist.

title: MSETNX

summary: Starts a transaction.

title: MULTI

summary: A container for object introspection commands.

title: OBJECT

summary: Returns the internal encoding of a Redis object.

title: OBJECT ENCODING

summary: Returns the logarithmic access frequency counter of a Redis object.

title: OBJECT FREQ

title: OBJECT HELP

summary: Returns the time since the last access to a Redis object.

title: OBJECT IDLETIME

summary: Returns the reference count of a value of a key.

title: OBJECT REFCOUNT

summary: Removes the expiration time of a key.

title: PERSIST

summary: Sets the expiration time of a key in milliseconds.

title: PEXPIRE

summary: Sets the expiration time of a key to a Unix milliseconds timestamp.

title: PEXPIREAT

summary: Returns the expiration time of a key as a Unix milliseconds timestamp.

title: PEXPIRETIME

summary: Adds elements to a HyperLogLog key. Creates the key if it doesn't exist.

title: PFADD

summary: Returns the approximated cardinality of the set(s) observed by the HyperLogLog key(s).

title: PFCOUNT

summary: Internal commands for debugging HyperLogLog values.

title: PFDEBUG

summary: Merges one or more HyperLogLog values into a single key.

title: PFMERGE

summary: An internal command for testing HyperLogLog values.

title: PFSELFTEST

summary: Returns the server's liveliness response.

title: PING

summary: Sets both string value and expiration time in milliseconds of a key. The key is created if it doesn't exist.

title: PSETEX

summary: Listens for messages published to channels that match one or more patterns.

title: PSUBSCRIBE

summary: An internal command used in replication.

title: PSYNC

summary: Returns the expiration time in milliseconds of a key.

title: PTTL

summary: Posts a message to a channel.

title: PUBLISH

summary: A container for Pub/Sub commands.

title: PUBSUB

summary: Returns the active channels.

title: PUBSUB CHANNELS

title: PUBSUB HELP

summary: Returns a count of unique pattern subscriptions.

title: PUBSUB NUMPAT

summary: Returns a count of subscribers to channels.

title: PUBSUB NUMSUB

summary: Returns the active shard channels.

title: PUBSUB SHARDCHANNELS

summary: Returns the count of subscribers of shard channels.

title: PUBSUB SHARDNUMSUB

summary: Stops listening to messages published to channels that match one or more patterns.

title: PUNSUBSCRIBE

summary: Closes the connection.

title: QUIT

summary: Returns a random key name from the database.

title: RANDOMKEY

summary: Enables read-only queries for a connection to a Redis Cluster replica node.

title: READONLY

summary: Enables read-write queries for a connection to a Redis Cluster replica node.

title: READWRITE

summary: Renames a key and overwrites the destination.

title: RENAME

summary: Renames a key only when the target key name doesn't exist.

title: RENAMENX

summary: An internal command for configuring the replication stream.

title: REPLCONF

summary: Configures a server as replica of another, or promotes it to a master.

title: REPLICAOF

summary: Resets the connection.

title: RESET

summary: Creates a key from the serialized representation of a value.

title: RESTORE

summary: An internal command for migrating keys in a cluster.

title: RESTORE-ASKING

summary: Returns the replication role.

title: ROLE

summary: Returns and removes the last elements of a list. Deletes the list if the last element was popped.

title: RPOP

summary: Returns the last element of a list after removing and pushing it to another list. Deletes the list if the last element was popped.

title: RPOPLPUSH

summary: Appends one or more elements to a list. Creates the key if it doesn't exist.

title: RPUSH

summary: Appends an element to a list only when the list exists.

title: RPUSHX

summary: Adds one or more members to a set. Creates the key if it doesn't exist.

title: SADD

summary: Synchronously saves the database(s) to disk.

title: SAVE

summary: Iterates over the key names in the database.

title: SCAN

summary: Returns the number of members in a set.

title: SCARD

summary: A container for Lua scripts management commands.

title: SCRIPT

summary: Sets the debug mode of server-side Lua scripts.

title: SCRIPT DEBUG

summary: Determines whether server-side Lua scripts exist in the script cache.

title: SCRIPT EXISTS

summary: Removes all server-side Lua scripts from the script cache.

title: SCRIPT FLUSH

title: SCRIPT HELP

summary: Terminates a server-side Lua script during execution.

title: SCRIPT KILL

summary: Loads a server-side Lua script to the script cache.

title: SCRIPT LOAD

summary: Returns the difference of multiple sets.

title: SDIFF

summary: Stores the difference of multiple sets in a key.

title: SDIFFSTORE

summary: Changes the selected database.

title: SELECT

summary: Sets the string value of a key, ignoring its type. The key is created if it doesn't exist.

title: SET

summary: Sets or clears the bit at offset of the string value. Creates the key if it doesn't exist.

title: SETBIT

summary: Sets the string value and expiration time of a key. Creates the key if it doesn't exist.

title: SETEX

summary: Set the string value of a key only when the key doesn't exist.

title: SETNX

summary: Overwrites a part of a string value with another by an offset. Creates the key if it doesn't exist.

title: SETRANGE

summary: Synchronously saves the database(s) to disk and shuts down the Redis server.

title: SHUTDOWN

summary: Returns the intersect of multiple sets.

title: SINTER

summary: Returns the number of members of the intersect of multiple sets.

title: SINTERCARD

summary: Stores the intersect of multiple sets in a key.

title: SINTERSTORE

summary: Determines whether a member belongs to a set.

title: SISMEMBER

summary: Sets a Redis server as a replica of another, or promotes it to being a master.

title: SLAVEOF

summary: A container for slow log commands.

title: SLOWLOG

summary: Returns the slow log's entries.

title: SLOWLOG GET

summary: Show helpful text about the different subcommands

title: SLOWLOG HELP

summary: Returns the number of entries in the slow log.

title: SLOWLOG LEN

summary: Clears all entries from the slow log.

title: SLOWLOG RESET

summary: Returns all members of a set.

title: SMEMBERS

summary: Determines whether multiple members belong to a set.

title: SMISMEMBER

summary: Moves a member from one set to another.

title: SMOVE

summary: Sorts the elements in a list, a set, or a sorted set, optionally storing the result.

title: SORT

summary: Returns the sorted elements of a list, a set, or a sorted set.

title: SORT_RO

summary: Returns one or more random members from a set after removing them. Deletes the set if the last member was popped.

title: SPOP

summary: Post a message to a shard channel

title: SPUBLISH

summary: Get one or multiple random members from a set

title: SRANDMEMBER

summary: Removes one or more members from a set. Deletes the set if the last member was removed.

title: SREM

summary: Iterates over members of a set.

title: SSCAN

summary: Listens for messages published to shard channels.

title: SSUBSCRIBE

summary: Returns the length of a string value.

title: STRLEN

summary: Listens for messages published to channels.

title: SUBSCRIBE

summary: Returns a substring from a string value.

title: SUBSTR

summary: Returns the union of multiple sets.

title: SUNION

summary: Stores the union of multiple sets in a key.

title: SUNIONSTORE

summary: Stops listening to messages posted to shard channels.

title: SUNSUBSCRIBE

summary: Swaps two Redis databases.

title: SWAPDB

title: SYNC

summary: Adds one or more observations to a t-digest sketch

title: TDIGEST.ADD

summary: Returns, for each input rank, a floating-point estimation of the value with that rank

title: TDIGEST.BYRANK

summary: Returns, for each input reverse rank, an estimation of the floating-point value with that reverse rank

title: TDIGEST.BYREVRANK

summary: Returns, for each input value, an estimation of the floating-point fraction of (observations smaller than the given value + half the observations equal to the given value)

title: TDIGEST.CDF

summary: Allocates memory and initializes a new t-digest sketch

title: TDIGEST.CREATE

summary: Returns information and statistics about a t-digest sketch

title: TDIGEST.INFO

summary: Returns the maximum observation value from a t-digest sketch

title: TDIGEST.MAX

summary: Merges multiple t-digest sketches into a single sketch

title: TDIGEST.MERGE

summary: Returns the minimum observation value from a t-digest sketch

title: TDIGEST.MIN

summary: Returns, for each input fraction, a floating-point estimation of the value that is smaller than the given fraction of observations

title: TDIGEST.QUANTILE

summary: Returns, for each floating-point input value, the estimated rank of the value (the number of observations in the sketch that are smaller than the value + half the number of observations that are equal to the value)

title: TDIGEST.RANK

summary: Resets a t-digest sketch (empties the sketch and re-initializes it).

title: TDIGEST.RESET

summary: Returns, for each floating-point input value, the estimated reverse rank of the value (the number of observations in the sketch that are larger than the value + half the number of observations that are equal to the value)

title: TDIGEST.REVRANK

summary: Returns an estimation of the mean value from the sketch, excluding observation values outside the low and high cutoff quantiles

title: TDIGEST.TRIMMED_MEAN

summary: Returns the server time.

title: TIME

summary: Adds an item to a Top-k sketch. Multiple items can be added at the same time.

title: TOPK.ADD

summary: Return the count for one or more items in a sketch

title: TOPK.COUNT

title: TOPK.INCRBY

summary: Returns information about a sketch

title: TOPK.INFO

summary: Return the full list of items in the Top-K sketch

title: TOPK.LIST

summary: Checks whether one or more items are in a sketch

title: TOPK.QUERY

summary: Initializes a Top-K sketch with specified parameters

title: TOPK.RESERVE

summary: Returns the number of existing keys out of those specified after updating the time they were last accessed.

title: TOUCH

summary: Append a sample to a time series

title: TS.ADD

summary: Update the retention, chunk size, duplicate policy, and labels of an existing time series

title: TS.ALTER

summary: Create a new time series

title: TS.CREATE

summary: Create a compaction rule.

title: TS.CREATERULE

summary: Decrease the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given decrement

title: TS.DECRBY

summary: Delete all samples between two timestamps for a given time series

title: TS.DEL

summary: Delete a compaction rule

title: TS.DELETERULE

summary: Get the sample with the highest timestamp from a given time series

title: TS.GET

summary: Increase the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given increment

title: TS.INCRBY

summary: Returns information and statistics for a time series

title: TS.INFO

summary: Append new samples to one or more time series

title: TS.MADD

summary: Get the sample with the highest timestamp from each time series matching a specific filter

title: TS.MGET

summary: Query a range across multiple time series by filters in forward direction

title: TS.MRANGE

summary: Query a range across multiple time-series by filters in reverse direction

title: TS.MREVRANGE

summary: Get all time series keys matching a filter list

title: TS.QUERYINDEX

summary: Query a range in forward direction

title: TS.RANGE

summary: Query a range in reverse direction

title: TS.REVRANGE

summary: Returns the expiration time in seconds of a key.

title: TTL

summary: Determines the type of value stored at a key.

title: TYPE

summary: Asynchronously deletes one or more keys.

title: UNLINK

summary: Stops listening to messages posted to channels.

title: UNSUBSCRIBE

summary: Forgets about watched keys of a transaction.

title: UNWATCH

summary: Add a new element to a vector set, or update its vector if it already exists.

title: VADD

summary: Return the number of elements in a vector set.

title: VCARD

summary: Return the dimension of vectors in the vector set.

title: VDIM

summary: Return the vector associated with an element.

title: VEMB

summary: Retrieve the JSON attributes of elements.

title: VGETATTR

summary: Return information about a vector set.

title: VINFO

summary: Check if an element exists in a vector set.

title: VISMEMBER

summary: Return the neighbors of an element at each layer in the HNSW graph.

title: VLINKS

summary: Return one or multiple random members from a vector set.

title: VRANDMEMBER

summary: Return elements in a lexicographical range

title: VRANGE

summary: Remove an element from a vector set.

title: VREM

summary: Associate or remove the JSON attributes of elements.

title: VSETATTR

summary: Return elements by vector similarity.

title: VSIM

summary: Blocks until the asynchronous replication of all preceding write commands sent by the connection is completed.

title: WAIT

summary: Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the master and/or replicas.

title: WAITAOF

summary: Monitors changes to keys to determine the execution of a transaction.

title: WATCH

summary: Returns the number of messages that were successfully acknowledged by the consumer group member of a stream.

title: XACK

summary: Acknowledges and conditionally deletes one or multiple entries for a stream consumer group.

title: XACKDEL

summary: Appends a new message to a stream. Creates the key if it doesn't exist.

title: XADD

summary: Changes, or acquires, ownership of messages in a consumer group, as if the messages were delivered to as consumer group member.

title: XAUTOCLAIM

summary: Sets the IDMP configuration parameters for a stream.

title: XCFGSET

summary: Changes, or acquires, ownership of a message in a consumer group, as if the message was delivered a consumer group member.

title: XCLAIM

summary: Returns the number of messages after removing them from a stream.

title: XDEL

summary: Deletes one or multiple entries from the stream.

title: XDELEX

summary: A container for consumer groups commands.

title: XGROUP

summary: Creates a consumer group.

title: XGROUP CREATE

summary: Creates a consumer in a consumer group.

title: XGROUP CREATECONSUMER

summary: Deletes a consumer from a consumer group.

title: XGROUP DELCONSUMER

summary: Destroys a consumer group.

title: XGROUP DESTROY

title: XGROUP HELP

summary: Sets the last-delivered ID of a consumer group.

title: XGROUP SETID

summary: A container for stream introspection commands.

title: XINFO

summary: Returns a list of the consumers in a consumer group.

title: XINFO CONSUMERS

summary: Returns a list of the consumer groups of a stream.

title: XINFO GROUPS

title: XINFO HELP

summary: Returns information about a stream.

title: XINFO STREAM

summary: Return the number of messages in a stream.

title: XLEN

summary: Returns the information and entries from a stream consumer group's pending entries list.

title: XPENDING

summary: Returns the messages from a stream within a range of IDs.

title: XRANGE

summary: Returns messages from multiple streams with IDs greater than the ones requested. Blocks until a message is available otherwise.

title: XREAD

summary: Returns new or historical messages from a stream for a consumer in a group. Blocks until a message is available otherwise.

title: XREADGROUP

summary: Returns the messages from a stream within a range of IDs in reverse order.

title: XREVRANGE

summary: An internal command for replicating stream values.

title: XSETID

summary: Deletes messages from the beginning of a stream.

title: XTRIM

summary: Adds one or more members to a sorted set, or updates their scores. Creates the key if it doesn't exist.

title: ZADD

summary: Returns the number of members in a sorted set.

title: ZCARD

summary: Returns the count of members in a sorted set that have scores within a range.

title: ZCOUNT

summary: Returns the difference between multiple sorted sets.

title: ZDIFF

summary: Stores the difference of multiple sorted sets in a key.

title: ZDIFFSTORE

summary: Increments the score of a member in a sorted set.

title: ZINCRBY

summary: Returns the intersect of multiple sorted sets.

title: ZINTER

summary: Returns the number of members of the intersect of multiple sorted sets.

title: ZINTERCARD

summary: Stores the intersect of multiple sorted sets in a key.

title: ZINTERSTORE

summary: Returns the number of members in a sorted set within a lexicographical range.

title: ZLEXCOUNT

summary: Returns the highest- or lowest-scoring members from one or more sorted sets after removing them. Deletes the sorted set if the last member was popped.

title: ZMPOP

summary: Returns the score of one or more members in a sorted set.

title: ZMSCORE

summary: Returns the highest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped.

title: ZPOPMAX

summary: Returns the lowest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped.

title: ZPOPMIN

summary: Returns one or more random members from a sorted set.

title: ZRANDMEMBER

summary: Returns members in a sorted set within a range of indexes.

title: ZRANGE

summary: Returns members in a sorted set within a lexicographical range.

title: ZRANGEBYLEX

summary: Returns members in a sorted set within a range of scores.

title: ZRANGEBYSCORE

summary: Stores a range of members from sorted set in a key.

title: ZRANGESTORE

summary: Returns the index of a member in a sorted set ordered by ascending scores.

title: ZRANK

summary: Removes one or more members from a sorted set. Deletes the sorted set if all members were removed.

title: ZREM

summary: Removes members in a sorted set within a lexicographical range. Deletes the sorted set if all members were removed.

title: ZREMRANGEBYLEX

summary: Removes members in a sorted set within a range of indexes. Deletes the sorted set if all members were removed.

title: ZREMRANGEBYRANK

summary: Removes members in a sorted set within a range of scores. Deletes the sorted set if all members were removed.

title: ZREMRANGEBYSCORE

summary: Returns members in a sorted set within a range of indexes in reverse order.

title: ZREVRANGE

summary: Returns members in a sorted set within a lexicographical range in reverse order.

title: ZREVRANGEBYLEX

summary: Returns members in a sorted set within a range of scores in reverse order.

title: ZREVRANGEBYSCORE

summary: Returns the index of a member in a sorted set ordered by descending scores.

title: ZREVRANK

summary: Iterates over members and scores of a sorted set.

title: ZSCAN

summary: Returns the score of a member in a sorted set.

title: ZSCORE

summary: Returns the union of multiple sorted sets.

title: ZUNION

summary: Stores the union of multiple sorted sets in a key.

title: ZUNIONSTORE

page_type: index