HTTL

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

Overview

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.

Example

[code example]

Return information

**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.

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


HVALS

Summary: Returns all values in a hash.

Examples

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

Redis Software and Redis Cloud compatibility

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

Return information

**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.

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

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

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

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

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]

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();

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]
            });

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]

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

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

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();

$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"]

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

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

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

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


INCR

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

Examples

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

Pattern: Counter

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.

Pattern: Rate limiter

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_.

Pattern: Rate limiter 1

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.

Pattern: Rate limiter 2

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.

Return information

**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.

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

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

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

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

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();
        }
    }
}

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();
        }
    }
}

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

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();

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();

<?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]

    }
}

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]

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}");
            }
        }

    }
}

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}");
            }
        }

    }
}

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

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

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

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


INCRBY

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

Overview

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.

Examples

SET mykey "10"
INCRBY mykey 5

Return information


INCRBYFLOAT

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

Overview

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.

Examples

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

Implementation details

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.

Return information

**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.


Commands

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

Redis 8.6 Commands Reference

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

Redis 8.4 Commands Reference

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

Redis 8.2 Commands Reference

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

Redis 8.0 Commands Reference

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

Redis 7.4 Commands Reference

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

Redis 7.2 Commands Reference

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

Redis 6.2 Commands Reference

Summary: A container for Access List Control commands.

ACL

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

ACL CAT

Summary: Deletes ACL users, and terminates their connections.

ACL DELUSER

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

ACL DRYRUN

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

ACL GENPASS

Summary: Lists the ACL rules of a user.

ACL GETUSER

Summary: Returns helpful text about the different subcommands.

ACL HELP

Summary: Dumps the effective rules in ACL file format.

ACL LIST

Summary: Reloads the rules from the configured ACL file.

ACL LOAD

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

ACL LOG

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

ACL SAVE

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

ACL SETUSER

Summary: Lists all ACL users.

ACL USERS

Summary: Returns the authenticated username of the current connection.

ACL WHOAMI

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

APPEND

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

ASKING

Summary: Authenticates the connection.

AUTH

Summary: Adds an item to a Bloom Filter

BF.ADD

Summary: Returns the cardinality of a Bloom filter

BF.CARD

Summary: Checks whether an item exists in a Bloom Filter

BF.EXISTS

Summary: Returns information about a Bloom Filter

BF.INFO

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

BF.INSERT

Summary: Restores a filter previously saved using SCANDUMP

BF.LOADCHUNK

BF.MADD

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

BF.MEXISTS

Summary: Creates a new Bloom Filter

BF.RESERVE

Summary: Begins an incremental save of the bloom filter

BF.SCANDUMP

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

BGREWRITEAOF

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

BGSAVE

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

BITCOUNT

Summary: Performs arbitrary bitfield integer operations on strings.

BITFIELD

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

BITFIELD_RO

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

BITOP

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

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.

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.

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.

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.

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.

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.

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.

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.

BZPOPMIN

Summary: Adds an item to a Cuckoo Filter

CF.ADD

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

CF.ADDNX

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

CF.COUNT

Summary: Deletes an item from a Cuckoo Filter

CF.DEL

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

CF.EXISTS

Summary: Returns information about a Cuckoo Filter

CF.INFO

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

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

CF.INSERTNX

Summary: Restores a filter previously saved using SCANDUMP

CF.LOADCHUNK

CF.MEXISTS

Summary: Creates a new Cuckoo Filter

CF.RESERVE

Summary: Begins an incremental save of the bloom filter

CF.SCANDUMP

Summary: A container for client connection commands.

CLIENT

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

CLIENT CACHING

Summary: Returns the name of the connection.

CLIENT GETNAME

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

CLIENT GETREDIR

Summary: Returns helpful text about the different subcommands.

CLIENT HELP

Summary: Returns the unique client ID of the connection.

CLIENT ID

Summary: Returns information about the connection.

CLIENT INFO

Summary: Terminates open connections.

CLIENT KILL

Summary: Lists open connections.

CLIENT LIST

Summary: Sets the client eviction mode of the connection.

CLIENT NO-EVICT

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

CLIENT NO-TOUCH

Summary: Suspends commands processing.

CLIENT PAUSE

Summary: Instructs the server whether to reply to commands.

CLIENT REPLY

Summary: Sets information specific to the client or connection.

CLIENT SETINFO

Summary: Sets the connection name.

CLIENT SETNAME

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

CLIENT TRACKING

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

CLIENT TRACKINGINFO

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

CLIENT UNBLOCK

Summary: Resumes processing commands from paused clients.

CLIENT UNPAUSE

Summary: A container for Redis Cluster commands.

CLUSTER

Summary: Assigns new hash slots to a node.

CLUSTER ADDSLOTS

Summary: Assigns new hash slot ranges to a node.

CLUSTER ADDSLOTSRANGE

Summary: Advances the cluster config epoch.

CLUSTER BUMPEPOCH

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

CLUSTER COUNT-FAILURE-REPORTS

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

CLUSTER COUNTKEYSINSLOT

Summary: Sets hash slots as unbound for a node.

CLUSTER DELSLOTS

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

CLUSTER DELSLOTSRANGE

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

CLUSTER FAILOVER

Summary: Deletes all slots information from a node.

CLUSTER FLUSHSLOTS

Summary: Removes a node from the nodes table.

CLUSTER FORGET

Summary: Returns the key names in a hash slot.

CLUSTER GETKEYSINSLOT

CLUSTER HELP

Summary: Returns information about the state of a node.

CLUSTER INFO

Summary: Returns the hash slot for a key.

CLUSTER KEYSLOT

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

CLUSTER LINKS

Summary: Forces a node to handshake with another node.

CLUSTER MEET

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

CLUSTER MIGRATION

Summary: Returns the ID of a node.

CLUSTER MYID

Summary: Returns the shard ID of a node.

CLUSTER MYSHARDID

Summary: Returns the cluster configuration for a node.

CLUSTER NODES

Summary: Lists the replica nodes of a master node.

CLUSTER REPLICAS

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

CLUSTER REPLICATE

Summary: Resets a node.

CLUSTER RESET

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

CLUSTER SAVECONFIG

Summary: Sets the configuration epoch for a new node.

CLUSTER SET-CONFIG-EPOCH

Summary: Binds a hash slot to a node.

CLUSTER SETSLOT

Summary: Returns the mapping of cluster slots to shards.

CLUSTER SHARDS

CLUSTER SLAVES

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

CLUSTER SLOT-STATS

Summary: Returns the mapping of cluster slots to nodes.

CLUSTER SLOTS

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

CMS.INCRBY

Summary: Returns information about a sketch

CMS.INFO

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

CMS.INITBYDIM

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

CMS.INITBYPROB

Summary: Merges several sketches into one sketch

CMS.MERGE

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

CMS.QUERY

Summary: Returns detailed information about all commands.

COMMAND

Summary: Returns a count of commands.

COMMAND COUNT

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

COMMAND DOCS

Summary: Extracts the key names from an arbitrary command.

COMMAND GETKEYS

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

COMMAND GETKEYSANDFLAGS

Summary: Returns helpful text about the different subcommands.

COMMAND HELP

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

COMMAND INFO

Summary: Returns a list of command names.

COMMAND LIST

Summary: A container for server configuration commands.

CONFIG

Summary: Returns the effective values of configuration parameters.

CONFIG GET

CONFIG HELP

Summary: Resets the server's statistics.

CONFIG RESETSTAT

Summary: Persists the effective configuration to file.

CONFIG REWRITE

Summary: Sets configuration parameters in-flight.

CONFIG SET

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

COPY

Summary: Returns the number of keys in the database.

DBSIZE

Summary: A container for debugging commands.

DEBUG

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

DECR

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

DECRBY

Summary: Deletes one or more keys.

DEL

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

DELEX

Summary: Returns the hash digest of a string value.

DIGEST

Summary: Discards a transaction.

DISCARD

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

DUMP

Summary: Returns the given string.

ECHO

Summary: Executes a server-side Lua script.

EVAL

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

EVAL_RO

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

EVALSHA

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

EVALSHA_RO

Summary: Executes all commands in a transaction.

EXEC

Summary: Determines whether one or more keys exist.

EXISTS

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

EXPIRE

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

EXPIREAT

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

EXPIRETIME

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

FAILOVER

Summary: Invokes a function.

FCALL

Summary: Invokes a read-only function.

FCALL_RO

Summary: Removes all keys from all databases.

FLUSHALL

Summary: Remove all keys from the current database.

FLUSHDB

Summary: Returns a list of all existing indexes

FT._LIST

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

FT.AGGREGATE

Summary: Adds an alias to the index

FT.ALIASADD

Summary: Deletes an alias from the index

FT.ALIASDEL

Summary: Adds or updates an alias to the index

FT.ALIASUPDATE

Summary: Adds a new field to the index

FT.ALTER

Summary: Retrieves runtime configuration options

FT.CONFIG GET

Summary: Help description of runtime configuration options

FT.CONFIG HELP

Summary: Sets runtime configuration options

FT.CONFIG SET

Summary: Creates an index with the given spec

FT.CREATE

Summary: Deletes a cursor

FT.CURSOR DEL

Summary: Reads from a cursor

FT.CURSOR READ

Summary: Adds terms to a dictionary

FT.DICTADD

Summary: Deletes terms from a dictionary

FT.DICTDEL

Summary: Dumps all terms in the given dictionary

FT.DICTDUMP

Summary: Deletes the index

FT.DROPINDEX

Summary: Returns the execution plan for a complex query

FT.EXPLAIN

FT.EXPLAINCLI

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

FT.HYBRID

Summary: Returns information and statistics on the index

FT.INFO

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

FT.PROFILE

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

FT.SEARCH

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

FT.SPELLCHECK

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

FT.SUGADD

Summary: Deletes a string from a suggestion index

FT.SUGDEL

Summary: Gets completion suggestions for a prefix

FT.SUGGET

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

FT.SUGLEN

Summary: Dumps the contents of a synonym group

FT.SYNDUMP

Summary: Creates or updates a synonym group with additional terms

FT.SYNUPDATE

Summary: Returns the distinct tags indexed in a Tag field

FT.TAGVALS

Summary: A container for function commands.

FUNCTION

Summary: Deletes a library and its functions.

FUNCTION DELETE

Summary: Dumps all libraries into a serialized binary payload.

FUNCTION DUMP

Summary: Deletes all libraries and functions.

FUNCTION FLUSH

Summary: Returns helpful text about the different subcommands.

FUNCTION HELP

Summary: Terminates a function during execution.

FUNCTION KILL

Summary: Returns information about all libraries.

FUNCTION LIST

Summary: Creates a library.

FUNCTION LOAD

Summary: Restores all libraries from a payload.

FUNCTION RESTORE

Summary: Returns information about a function during execution.

FUNCTION STATS

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

GEOADD

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

GEODIST

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

GEOHASH

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

GEOPOS

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

GEORADIUS

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

GEORADIUS_RO

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

GEORADIUSBYMEMBER

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

GEORADIUSBYMEMBER_RO

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

GEOSEARCH

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

GEOSEARCHSTORE

Summary: Returns the string value of a key.

GET

Summary: Returns a bit value by offset.

GETBIT

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

GETDEL

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

GETEX

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

GETRANGE

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

GETSET

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

HDEL

Summary: Handshakes with the Redis server.

HELLO

Summary: Determines whether a field exists in a hash.

HEXISTS

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

HEXPIRE

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

HEXPIREAT

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

HEXPIRETIME

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

HGET

Summary: Returns all fields and values in a hash.

HGETALL

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

HGETDEL

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

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.

HINCRBY

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

HINCRBYFLOAT

Summary: Returns all fields in a hash.

HKEYS

Summary: Returns the number of fields in a hash.

HLEN

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

HMGET

Summary: Sets the values of multiple fields.

HMSET

Summary: A container for hotkeys tracking commands.

HOTKEYS

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

HOTKEYS GET

Summary: Returns helpful text about HOTKEYS commands and parameters.

HOTKEYS HELP

Summary: Release the resources used for hotkey tracking.

HOTKEYS RESET

Summary: Starts hotkeys tracking.

HOTKEYS START

Summary: Stops hotkeys tracking.

HOTKEYS STOP

Summary: Removes the expiration time for each specified field

HPERSIST

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

HPEXPIRE

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

HPEXPIREAT

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

HPEXPIRETIME

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

HPTTL

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

HRANDFIELD

Summary: Iterates over fields and values of a hash.

HSCAN

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

HSET

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

HSETEX

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

HSETNX

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

HSTRLEN

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

HTTL

Summary: Returns all values in a hash.

HVALS

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

INCR

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

INCRBY

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

INCRBYFLOAT

Summary: Returns information and statistics about the server.

INFO

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

JSON.ARRAPPEND

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

JSON.ARRINDEX

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

JSON.ARRINSERT

Summary: Returns the length of the array at path

JSON.ARRLEN

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

JSON.ARRPOP

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

JSON.ARRTRIM

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

JSON.CLEAR

Summary: Debugging container command

JSON.DEBUG

Summary: Shows helpful information

JSON.DEBUG HELP

Summary: Reports the size in bytes of a key

JSON.DEBUG MEMORY

Summary: Deletes a value

JSON.DEL

Summary: Deletes a value

JSON.FORGET

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

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

JSON.MERGE

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

JSON.MGET

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

JSON.MSET

Summary: Increments the numeric value at path by a value

JSON.NUMINCRBY

Summary: Multiplies the numeric value at path by a value

JSON.NUMMULTBY

Summary: Returns the JSON keys of the object at path

JSON.OBJKEYS

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

JSON.OBJLEN

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

JSON.RESP

Summary: Sets or updates the JSON value at a path

JSON.SET

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

JSON.STRAPPEND

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

JSON.STRLEN

Summary: Toggles a boolean value

JSON.TOGGLE

Summary: Returns the type of the JSON value at path

JSON.TYPE

Summary: Returns all key names that match a pattern.

KEYS

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

LASTSAVE

Summary: A container for latency diagnostics commands.

LATENCY

Summary: Returns a human-readable latency analysis report.

LATENCY DOCTOR

Summary: Returns a latency graph for an event.

LATENCY GRAPH

Summary: Returns helpful text about the different subcommands.

LATENCY HELP

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

LATENCY HISTOGRAM

Summary: Returns timestamp-latency samples for an event.

LATENCY HISTORY

Summary: Returns the latest latency samples for all events.

LATENCY LATEST

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

LATENCY RESET

Summary: Finds the longest common substring.

LCS

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

LINDEX

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

LINSERT

Summary: Returns the length of a list.

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.

LMOVE

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

LMPOP

Summary: Displays computer art and the Redis version

LOLWUT

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

LPOP

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

LPOS

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

LPUSH

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

LPUSHX

Summary: Returns a range of elements from a list.

LRANGE

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

LREM

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

LSET

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

LTRIM

Summary: A container for memory diagnostics commands.

MEMORY

Summary: Outputs a memory problems report.

MEMORY DOCTOR

Summary: Returns helpful text about the different subcommands.

MEMORY HELP

Summary: Returns the allocator statistics.

MEMORY MALLOC-STATS

Summary: Asks the allocator to release memory.

MEMORY PURGE

Summary: Returns details about memory usage.

MEMORY STATS

Summary: Estimates the memory usage of a key.

MEMORY USAGE

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

MGET

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

MIGRATE

Summary: A container for module commands.

MODULE

MODULE HELP

Summary: Returns all loaded modules.

MODULE LIST

Summary: Loads a module.

MODULE LOAD

Summary: Loads a module using extended parameters.

MODULE LOADEX

Summary: Unloads a module.

MODULE UNLOAD

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

MONITOR

Summary: Moves a key to another database.

MOVE

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

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.

MSETEX

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

MSETNX

Summary: Starts a transaction.

MULTI

Summary: A container for object introspection commands.

OBJECT

Summary: Returns the internal encoding of a Redis object.

OBJECT ENCODING

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

OBJECT FREQ

OBJECT HELP

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

OBJECT IDLETIME

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

OBJECT REFCOUNT

Summary: Removes the expiration time of a key.

PERSIST

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

PEXPIRE

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

PEXPIREAT

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

PEXPIRETIME

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

PFADD

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

PFCOUNT

Summary: Internal commands for debugging HyperLogLog values.

PFDEBUG

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

PFMERGE

Summary: An internal command for testing HyperLogLog values.

PFSELFTEST

Summary: Returns the server's liveliness response.

PING

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

PSETEX

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

PSUBSCRIBE

Summary: An internal command used in replication.

PSYNC

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

PTTL

Summary: Posts a message to a channel.

PUBLISH

Summary: A container for Pub/Sub commands.

PUBSUB

Summary: Returns the active channels.

PUBSUB CHANNELS

Summary: Returns helpful text about the different subcommands.

PUBSUB HELP

Summary: Returns a count of unique pattern subscriptions.

PUBSUB NUMPAT

Summary: Returns a count of subscribers to channels.

PUBSUB NUMSUB

Summary: Returns the active shard channels.

PUBSUB SHARDCHANNELS

Summary: Returns the count of subscribers of shard channels.

PUBSUB SHARDNUMSUB

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

PUNSUBSCRIBE

Summary: Closes the connection.

QUIT

Summary: Returns a random key name from the database.

RANDOMKEY

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

READONLY

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

READWRITE

Summary: Renames a key and overwrites the destination.

RENAME

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

RENAMENX

Summary: An internal command for configuring the replication stream.

REPLCONF

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

REPLICAOF

Summary: Resets the connection.

RESET

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

RESTORE

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

RESTORE-ASKING

Summary: Returns the replication role.

ROLE

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

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.

RPOPLPUSH

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

RPUSH

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

RPUSHX

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

SADD

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

SAVE

Summary: Iterates over the key names in the database.

SCAN

Summary: Returns the number of members in a set.

SCARD

Summary: A container for Lua scripts management commands.

SCRIPT

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

SCRIPT DEBUG

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

SCRIPT EXISTS

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

SCRIPT FLUSH

Summary: Returns helpful text about the different subcommands.

SCRIPT HELP

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

SCRIPT KILL

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

SCRIPT LOAD

Summary: Returns the difference of multiple sets.

SDIFF

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

SDIFFSTORE

Summary: Changes the selected database.

SELECT

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

SET

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

SETBIT

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

SETEX

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

SETNX

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

SETRANGE

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

SHUTDOWN

Summary: Returns the intersect of multiple sets.

SINTER

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

SINTERCARD

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

SINTERSTORE

Summary: Determines whether a member belongs to a set.

SISMEMBER

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

SLAVEOF

Summary: A container for slow log commands.

SLOWLOG

Summary: Returns the slow log's entries.

SLOWLOG GET

Summary: Show helpful text about the different subcommands

SLOWLOG HELP

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

SLOWLOG LEN

Summary: Clears all entries from the slow log.

SLOWLOG RESET

Summary: Returns all members of a set.

SMEMBERS

Summary: Determines whether multiple members belong to a set.

SMISMEMBER

Summary: Moves a member from one set to another.

SMOVE

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

SORT

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

SORT_RO

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

SPOP

Summary: Post a message to a shard channel

SPUBLISH

Summary: Get one or multiple random members from a set

SRANDMEMBER

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

SREM

Summary: Iterates over members of a set.

SSCAN

Summary: Listens for messages published to shard channels.

SSUBSCRIBE

Summary: Returns the length of a string value.

STRLEN

Summary: Listens for messages published to channels.

SUBSCRIBE

Summary: Returns a substring from a string value.

SUBSTR

Summary: Returns the union of multiple sets.

SUNION

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

SUNIONSTORE

Summary: Stops listening to messages posted to shard channels.

SUNSUBSCRIBE

Summary: Swaps two Redis databases.

SWAPDB

Summary: An internal command used in replication.

SYNC

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

TDIGEST.ADD

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

TDIGEST.BYRANK

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

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)

TDIGEST.CDF

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

TDIGEST.CREATE

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

TDIGEST.INFO

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

TDIGEST.MAX

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

TDIGEST.MERGE

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

TDIGEST.MIN

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

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)

TDIGEST.RANK

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

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)

TDIGEST.REVRANK

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

TDIGEST.TRIMMED_MEAN

Summary: Returns the server time.

TIME

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

TOPK.ADD

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

TOPK.COUNT

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

TOPK.INCRBY

Summary: Returns information about a sketch

TOPK.INFO

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

TOPK.LIST

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

TOPK.QUERY

Summary: Initializes a Top-K sketch with specified parameters

TOPK.RESERVE

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

TOUCH

Summary: Append a sample to a time series

TS.ADD

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

TS.ALTER

Summary: Create a new time series

TS.CREATE

Summary: Create a compaction rule.

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

TS.DECRBY

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

TS.DEL

Summary: Delete a compaction rule

TS.DELETERULE

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

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

TS.INCRBY

Summary: Returns information and statistics for a time series

TS.INFO

Summary: Append new samples to one or more time series

TS.MADD

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

TS.MGET

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

TS.MRANGE

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

TS.MREVRANGE

Summary: Get all time series keys matching a filter list

TS.QUERYINDEX

Summary: Query a range in forward direction

TS.RANGE

Summary: Query a range in reverse direction

TS.REVRANGE

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

TTL

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

TYPE

Summary: Asynchronously deletes one or more keys.

UNLINK

Summary: Stops listening to messages posted to channels.

UNSUBSCRIBE

Summary: Forgets about watched keys of a transaction.

UNWATCH

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

VADD

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

VCARD

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

VDIM

Summary: Return the vector associated with an element.

VEMB

Summary: Retrieve the JSON attributes of elements.

VGETATTR

Summary: Return information about a vector set.

VINFO

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

VISMEMBER

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

VLINKS

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

VRANDMEMBER

Summary: Return elements in a lexicographical range

VRANGE

Summary: Remove an element from a vector set.

VREM

Summary: Associate or remove the JSON attributes of elements.

VSETATTR

Summary: Return elements by vector similarity.

VSIM

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

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.

WAITAOF

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

WATCH

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

XACK

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

XACKDEL

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

XADD

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

XAUTOCLAIM

Summary: Sets the IDMP configuration parameters for a stream.

XCFGSET

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

XCLAIM

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

XDEL

Summary: Deletes one or multiple entries from the stream.

XDELEX

Summary: A container for consumer groups commands.

XGROUP

Summary: Creates a consumer group.

XGROUP CREATE

Summary: Creates a consumer in a consumer group.

XGROUP CREATECONSUMER

Summary: Deletes a consumer from a consumer group.

XGROUP DELCONSUMER

Summary: Destroys a consumer group.

XGROUP DESTROY

Summary: Returns helpful text about the different subcommands.

XGROUP HELP

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

XGROUP SETID

Summary: A container for stream introspection commands.

XINFO

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

XINFO CONSUMERS

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

XINFO GROUPS

XINFO HELP

Summary: Returns information about a stream.

XINFO STREAM

Summary: Return the number of messages in a stream.

XLEN

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

XPENDING

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

XRANGE

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

XREAD

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

XREADGROUP

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

XREVRANGE

Summary: An internal command for replicating stream values.

XSETID

Summary: Deletes messages from the beginning of a stream.

XTRIM

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

ZADD

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

ZCARD

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

ZCOUNT

Summary: Returns the difference between multiple sorted sets.

ZDIFF

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

ZDIFFSTORE

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

ZINCRBY

Summary: Returns the intersect of multiple sorted sets.

ZINTER

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

ZINTERCARD

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

ZINTERSTORE

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

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.

ZMPOP

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

ZMSCORE

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

ZPOPMAX

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

ZPOPMIN

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

ZRANDMEMBER

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

ZRANGE

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

ZRANGEBYLEX

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

ZRANGEBYSCORE

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

ZRANGESTORE

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

ZRANK

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

ZREM

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

ZREMRANGEBYLEX

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

ZREMRANGEBYRANK

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

ZREMRANGEBYSCORE

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

ZREVRANGE

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

ZREVRANGEBYLEX

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

ZREVRANGEBYSCORE

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

ZREVRANK

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

ZSCAN

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

ZSCORE

Summary: Returns the union of multiple sorted sets.

ZUNION

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

ZUNIONSTORE