Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Redis

This is the major component of ioredis. Use it to connect to a standalone Redis server or Sentinels.

const redis = new Redis(); // Default port is 6379
async function main() {
redis.set("foo", "bar");
redis.get("foo", (err, result) => {
// `result` should be "bar"
console.log(err, result);
});
// Or use Promise
const result = await redis.get("foo");
}

Hierarchy

  • Commander
  • EventEmitter
  • Transaction
    • Redis

Index

Constructors

Properties

Accessors

Methods

Constructors

Properties

options: RedisOptions
status: RedisStatus = "wait"
Cluster: typeof Cluster = Cluster
Command: typeof default = Command

Accessors

  • get autoPipelineQueueSize(): number

Methods

  • acl(subcommand: "CAT", callback?: Callback<unknown>): Promise<unknown>
  • acl(subcommand: "CAT", categoryname: string | Buffer, callback?: Callback<unknown>): Promise<unknown>
  • acl(...args: [subcommand: "DELUSER", ...usernames: (string | Buffer)[], callback: Callback<number>]): Promise<number>
  • acl(...args: [subcommand: "DELUSER", ...usernames: (string | Buffer)[]]): Promise<number>
  • acl(subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, callback?: Callback<string>): Promise<string>
  • acl(...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[], callback: Callback<string>]): Promise<string>
  • acl(...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[]]): Promise<string>
  • acl(subcommand: "GENPASS", callback?: Callback<string>): Promise<string>
  • acl(subcommand: "GENPASS", bits: string | number, callback?: Callback<string>): Promise<string>
  • acl(subcommand: "GETUSER", username: string | Buffer, callback?: Callback<string[]>): Promise<string[]>
  • acl(subcommand: "HELP", callback?: Callback<unknown>): Promise<unknown>
  • acl(subcommand: "LIST", callback?: Callback<string[]>): Promise<string[]>
  • acl(subcommand: "LOAD", callback?: Callback<"OK">): Promise<"OK">
  • acl(subcommand: "LOG", callback?: Callback<unknown>): Promise<unknown>
  • acl(subcommand: "LOG", count: string | number, callback?: Callback<unknown>): Promise<unknown>
  • acl(subcommand: "LOG", reset: "RESET", callback?: Callback<unknown>): Promise<unknown>
  • acl(subcommand: "SAVE", callback?: Callback<"OK">): Promise<"OK">
  • acl(subcommand: "SETUSER", username: string | Buffer, callback?: Callback<"OK">): Promise<"OK">
  • acl(...args: [subcommand: "SETUSER", username: string | Buffer, ...rules: (string | Buffer)[], callback: Callback<"OK">]): Promise<"OK">
  • acl(...args: [subcommand: "SETUSER", username: string | Buffer, ...rules: (string | Buffer)[]]): Promise<"OK">
  • acl(subcommand: "USERS", callback?: Callback<string[]>): Promise<string[]>
  • acl(subcommand: "WHOAMI", callback?: Callback<string>): Promise<string>
  • List the ACL categories or the commands inside a category

    • group: server
    • complexity: O(1) since the categories and commands are a fixed set.
    • since: 6.0.0

    Parameters

    • subcommand: "CAT"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • subcommand: "CAT"
    • categoryname: string | Buffer
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Remove the specified ACL users and the associated rules

    • group: server
    • complexity: O(1) amortized time considering the typical user.
    • since: 6.0.0

    Parameters

    • Rest ...args: [subcommand: "DELUSER", ...usernames: (string | Buffer)[], callback: Callback<number>]

    Returns Promise<number>

  • Parameters

    • Rest ...args: [subcommand: "DELUSER", ...usernames: (string | Buffer)[]]

    Returns Promise<number>

  • Returns whether the user can execute the given command without executing the command.

    • group: server
    • complexity: O(1).
    • since: 7.0.0

    Parameters

    • subcommand: "DRYRUN"
    • username: string | Buffer
    • command: string | Buffer
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Parameters

    • Rest ...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[], callback: Callback<string>]

    Returns Promise<string>

  • Parameters

    • Rest ...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[]]

    Returns Promise<string>

  • Generate a pseudorandom secure password to use for ACL users

    • group: server
    • complexity: O(1)
    • since: 6.0.0

    Parameters

    • subcommand: "GENPASS"
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Parameters

    • subcommand: "GENPASS"
    • bits: string | number
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Get the rules for a specific ACL user

    • group: server
    • complexity: O(N). Where N is the number of password, command and pattern rules that the user has.
    • since: 6.0.0

    Parameters

    • subcommand: "GETUSER"
    • username: string | Buffer
    • Optional callback: Callback<string[]>

    Returns Promise<string[]>

  • Show helpful text about the different subcommands

    • group: server
    • complexity: O(1)
    • since: 6.0.0

    Parameters

    • subcommand: "HELP"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • List the current ACL rules in ACL config file format

    • group: server
    • complexity: O(N). Where N is the number of configured users.
    • since: 6.0.0

    Parameters

    • subcommand: "LIST"
    • Optional callback: Callback<string[]>

    Returns Promise<string[]>

  • Reload the ACLs from the configured ACL file

    • group: server
    • complexity: O(N). Where N is the number of configured users.
    • since: 6.0.0

    Parameters

    • subcommand: "LOAD"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • List latest events denied because of ACLs in place

    • group: server
    • complexity: O(N) with N being the number of entries shown.
    • since: 6.0.0

    Parameters

    • subcommand: "LOG"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • subcommand: "LOG"
    • count: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • subcommand: "LOG"
    • reset: "RESET"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Save the current ACL rules in the configured ACL file

    • group: server
    • complexity: O(N). Where N is the number of configured users.
    • since: 6.0.0

    Parameters

    • subcommand: "SAVE"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Modify or create the rules for a specific ACL user

    • group: server
    • complexity: O(N). Where N is the number of rules provided.
    • since: 6.0.0

    Parameters

    • subcommand: "SETUSER"
    • username: string | Buffer
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • Rest ...args: [subcommand: "SETUSER", username: string | Buffer, ...rules: (string | Buffer)[], callback: Callback<"OK">]

    Returns Promise<"OK">

  • Parameters

    • Rest ...args: [subcommand: "SETUSER", username: string | Buffer, ...rules: (string | Buffer)[]]

    Returns Promise<"OK">

  • List the username of all the configured ACL rules

    • group: server
    • complexity: O(N). Where N is the number of configured users.
    • since: 6.0.0

    Parameters

    • subcommand: "USERS"
    • Optional callback: Callback<string[]>

    Returns Promise<string[]>

  • Return the name of the user associated to the current connection

    • group: server
    • complexity: O(1)
    • since: 6.0.0

    Parameters

    • subcommand: "WHOAMI"
    • Optional callback: Callback<string>

    Returns Promise<string>

  • aclBuffer(subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, callback?: Callback<Buffer>): Promise<Buffer>
  • aclBuffer(...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[], callback: Callback<Buffer>]): Promise<Buffer>
  • aclBuffer(...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[]]): Promise<Buffer>
  • aclBuffer(subcommand: "GENPASS", callback?: Callback<Buffer>): Promise<Buffer>
  • aclBuffer(subcommand: "GENPASS", bits: string | number, callback?: Callback<Buffer>): Promise<Buffer>
  • aclBuffer(subcommand: "GETUSER", username: string | Buffer, callback?: Callback<Buffer[]>): Promise<Buffer[]>
  • aclBuffer(subcommand: "LIST", callback?: Callback<Buffer[]>): Promise<Buffer[]>
  • aclBuffer(subcommand: "USERS", callback?: Callback<Buffer[]>): Promise<Buffer[]>
  • aclBuffer(subcommand: "WHOAMI", callback?: Callback<Buffer>): Promise<Buffer>
  • Parameters

    • subcommand: "DRYRUN"
    • username: string | Buffer
    • command: string | Buffer
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • Parameters

    • Rest ...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[], callback: Callback<Buffer>]

    Returns Promise<Buffer>

  • Parameters

    • Rest ...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[]]

    Returns Promise<Buffer>

  • Parameters

    • subcommand: "GENPASS"
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • Parameters

    • subcommand: "GENPASS"
    • bits: string | number
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • Parameters

    • subcommand: "GETUSER"
    • username: string | Buffer
    • Optional callback: Callback<Buffer[]>

    Returns Promise<Buffer[]>

  • Parameters

    • subcommand: "LIST"
    • Optional callback: Callback<Buffer[]>

    Returns Promise<Buffer[]>

  • Parameters

    • subcommand: "USERS"
    • Optional callback: Callback<Buffer[]>

    Returns Promise<Buffer[]>

  • Parameters

    • subcommand: "WHOAMI"
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • addBuiltinCommand(commandName: string): void
  • Create add builtin command

    Parameters

    • commandName: string

    Returns void

  • append(key: RedisKey, value: string | number | Buffer, callback?: Callback<number>): Promise<number>
  • Append a value to a key

    • group: string
    • complexity: O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation.
    • since: 2.0.0

    Parameters

    • key: RedisKey
    • value: string | number | Buffer
    • Optional callback: Callback<number>

    Returns Promise<number>

  • asking(callback?: Callback<"OK">): Promise<"OK">
  • Sent by cluster clients after an -ASK redirect

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • auth(password: string | Buffer, callback?: Callback<"OK">): Promise<"OK">
  • auth(username: string | Buffer, password: string | Buffer, callback?: Callback<"OK">): Promise<"OK">
  • Authenticate to the server

    • group: connection
    • complexity: O(N) where N is the number of passwords defined for the user
    • since: 1.0.0

    Parameters

    • password: string | Buffer
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • username: string | Buffer
    • password: string | Buffer
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • bgrewriteaof(callback?: Callback<string>): Promise<string>
  • Asynchronously rewrite the append-only file

    • group: server
    • complexity: O(1)
    • since: 1.0.0

    Parameters

    • Optional callback: Callback<string>

    Returns Promise<string>

  • bgrewriteaofBuffer(callback?: Callback<Buffer>): Promise<Buffer>
  • Parameters

    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • bgsave(callback?: Callback<"OK">): Promise<"OK">
  • bgsave(schedule: "SCHEDULE", callback?: Callback<"OK">): Promise<"OK">
  • Asynchronously save the dataset to disk

    • group: server
    • complexity: O(1)
    • since: 1.0.0

    Parameters

    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • schedule: "SCHEDULE"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • bitcount(key: RedisKey, callback?: Callback<number>): Promise<number>
  • bitcount(key: RedisKey, start: string | number, end: string | number, callback?: Callback<number>): Promise<number>
  • bitcount(key: RedisKey, start: string | number, end: string | number, byte: "BYTE", callback?: Callback<number>): Promise<number>
  • bitcount(key: RedisKey, start: string | number, end: string | number, bit: "BIT", callback?: Callback<number>): Promise<number>
  • Count set bits in a string

    • group: bitmap
    • complexity: O(N)
    • since: 2.6.0

    Parameters

    • key: RedisKey
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Parameters

    • key: RedisKey
    • start: string | number
    • end: string | number
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Parameters

    • key: RedisKey
    • start: string | number
    • end: string | number
    • byte: "BYTE"
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Parameters

    • key: RedisKey
    • start: string | number
    • end: string | number
    • bit: "BIT"
    • Optional callback: Callback<number>

    Returns Promise<number>

  • bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: string | number, callback?: Callback<unknown>): Promise<unknown>
  • bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: string | number, value: string | number, callback?: Callback<unknown>): Promise<unknown>
  • bitfield(key: RedisKey, encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: string | number, increment: string | number, callback?: Callback<unknown>): Promise<unknown>
  • bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: string | number, value: string | number, callback?: Callback<unknown>): Promise<unknown>
  • bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: string | number, increment: string | number, callback?: Callback<unknown>): Promise<unknown>
  • bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: string | number, value: string | number, callback?: Callback<unknown>): Promise<unknown>
  • bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: string | number, increment: string | number, callback?: Callback<unknown>): Promise<unknown>
  • bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: string | number, value: string | number, callback?: Callback<unknown>): Promise<unknown>
  • bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: string | number, increment: string | number, callback?: Callback<unknown>): Promise<unknown>
  • Perform arbitrary bitfield integer operations on strings

    • group: bitmap
    • complexity: O(1) for each subcommand specified
    • since: 3.2.0

    Parameters

    • key: RedisKey
    • encodingOffsetToken: "GET"
    • encoding: string | Buffer
    • offset: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • key: RedisKey
    • encodingOffsetValueToken: "SET"
    • encoding: string | Buffer
    • offset: string | number
    • value: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • key: RedisKey
    • encodingOffsetIncrementToken: "INCRBY"
    • encoding: string | Buffer
    • offset: string | number
    • increment: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • key: RedisKey
    • overflow: "OVERFLOW"
    • wrap: "WRAP"
    • encodingOffsetValueToken: "SET"
    • encoding: string | Buffer
    • offset: string | number
    • value: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • key: RedisKey
    • overflow: "OVERFLOW"
    • wrap: "WRAP"
    • encodingOffsetIncrementToken: "INCRBY"
    • encoding: string | Buffer
    • offset: string | number
    • increment: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • key: RedisKey
    • overflow: "OVERFLOW"
    • sat: "SAT"
    • encodingOffsetValueToken: "SET"
    • encoding: string | Buffer
    • offset: string | number
    • value: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • key: RedisKey
    • overflow: "OVERFLOW"
    • sat: "SAT"
    • encodingOffsetIncrementToken: "INCRBY"
    • encoding: string | Buffer
    • offset: string | number
    • increment: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • key: RedisKey
    • overflow: "OVERFLOW"
    • fail: "FAIL"
    • encodingOffsetValueToken: "SET"
    • encoding: string | Buffer
    • offset: string | number
    • value: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • key: RedisKey
    • overflow: "OVERFLOW"
    • fail: "FAIL"
    • encodingOffsetIncrementToken: "INCRBY"
    • encoding: string | Buffer
    • offset: string | number
    • increment: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • bitfield_ro(...args: [key: RedisKey, encodingOffsetToken: "GET", ...encodingOffsets: (string | number | Buffer)[], callback: Callback<unknown[]>]): Promise<unknown[]>
  • bitfield_ro(...args: [key: RedisKey, encodingOffsetToken: "GET", ...encodingOffsets: (string | number | Buffer)[]]): Promise<unknown[]>
  • Perform arbitrary bitfield integer operations on strings. Read-only variant of BITFIELD

    • group: bitmap
    • complexity: O(1) for each subcommand specified
    • since: 6.0.0

    Parameters

    • Rest ...args: [key: RedisKey, encodingOffsetToken: "GET", ...encodingOffsets: (string | number | Buffer)[], callback: Callback<unknown[]>]

    Returns Promise<unknown[]>

  • Parameters

    • Rest ...args: [key: RedisKey, encodingOffsetToken: "GET", ...encodingOffsets: (string | number | Buffer)[]]

    Returns Promise<unknown[]>

  • bitop(...args: [operation: string | Buffer, destkey: RedisKey, ...keys: RedisKey[], callback: Callback<number>]): Promise<number>
  • bitop(...args: [operation: string | Buffer, destkey: RedisKey, keys: RedisKey[], callback: Callback<number>]): Promise<number>
  • bitop(...args: [operation: string | Buffer, destkey: RedisKey, ...keys: RedisKey[]]): Promise<number>
  • bitop(...args: [operation: string | Buffer, destkey: RedisKey, keys: RedisKey[]]): Promise<number>
  • Perform bitwise operations between strings

    • group: bitmap
    • complexity: O(N)
    • since: 2.6.0

    Parameters

    • Rest ...args: [operation: string | Buffer, destkey: RedisKey, ...keys: RedisKey[], callback: Callback<number>]

    Returns Promise<number>

  • Parameters

    • Rest ...args: [operation: string | Buffer, destkey: RedisKey, keys: RedisKey[], callback: Callback<number>]

    Returns Promise<number>

  • Parameters

    • Rest ...args: [operation: string | Buffer, destkey: RedisKey, ...keys: RedisKey[]]

    Returns Promise<number>

  • Parameters

    Returns Promise<number>

  • bitpos(key: RedisKey, bit: string | number, callback?: Callback<number>): Promise<number>
  • bitpos(key: RedisKey, bit: string | number, start: string | number, callback?: Callback<number>): Promise<number>
  • bitpos(key: RedisKey, bit: string | number, start: string | number, end: string | number, callback?: Callback<number>): Promise<number>
  • bitpos(key: RedisKey, bit: string | number, start: string | number, end: string | number, byte: "BYTE", callback?: Callback<number>): Promise<number>
  • bitpos(key: RedisKey, bit: string | number, start: string | number, end: string | number, bit1: "BIT", callback?: Callback<number>): Promise<number>
  • Find first bit set or clear in a string

    • group: bitmap
    • complexity: O(N)
    • since: 2.8.7

    Parameters

    • key: RedisKey
    • bit: string | number
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Parameters

    • key: RedisKey
    • bit: string | number
    • start: string | number
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Parameters

    • key: RedisKey
    • bit: string | number
    • start: string | number
    • end: string | number
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Parameters

    • key: RedisKey
    • bit: string | number
    • start: string | number
    • end: string | number
    • byte: "BYTE"
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Parameters

    • key: RedisKey
    • bit: string | number
    • start: string | number
    • end: string | number
    • bit1: "BIT"
    • Optional callback: Callback<number>

    Returns Promise<number>

  • blmove(source: RedisKey, destination: RedisKey, left: "LEFT", left1: "LEFT", timeout: string | number, callback?: Callback<string>): Promise<string>
  • blmove(source: RedisKey, destination: RedisKey, left: "LEFT", right: "RIGHT", timeout: string | number, callback?: Callback<string>): Promise<string>
  • blmove(source: RedisKey, destination: RedisKey, right: "RIGHT", left: "LEFT", timeout: string | number, callback?: Callback<string>): Promise<string>
  • blmove(source: RedisKey, destination: RedisKey, right: "RIGHT", right1: "RIGHT", timeout: string | number, callback?: Callback<string>): Promise<string>
  • Pop an element from a list, push it to another list and return it; or block until one is available

    • group: list
    • complexity: O(1)
    • since: 6.2.0

    Parameters

    • source: RedisKey
    • destination: RedisKey
    • left: "LEFT"
    • left1: "LEFT"
    • timeout: string | number
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Parameters

    • source: RedisKey
    • destination: RedisKey
    • left: "LEFT"
    • right: "RIGHT"
    • timeout: string | number
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Parameters

    • source: RedisKey
    • destination: RedisKey
    • right: "RIGHT"
    • left: "LEFT"
    • timeout: string | number
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Parameters

    • source: RedisKey
    • destination: RedisKey
    • right: "RIGHT"
    • right1: "RIGHT"
    • timeout: string | number
    • Optional callback: Callback<string>

    Returns Promise<string>

  • blmoveBuffer(source: RedisKey, destination: RedisKey, left: "LEFT", left1: "LEFT", timeout: string | number, callback?: Callback<Buffer>): Promise<Buffer>
  • blmoveBuffer(source: RedisKey, destination: RedisKey, left: "LEFT", right: "RIGHT", timeout: string | number, callback?: Callback<Buffer>): Promise<Buffer>
  • blmoveBuffer(source: RedisKey, destination: RedisKey, right: "RIGHT", left: "LEFT", timeout: string | number, callback?: Callback<Buffer>): Promise<Buffer>
  • blmoveBuffer(source: RedisKey, destination: RedisKey, right: "RIGHT", right1: "RIGHT", timeout: string | number, callback?: Callback<Buffer>): Promise<Buffer>
  • Parameters

    • source: RedisKey
    • destination: RedisKey
    • left: "LEFT"
    • left1: "LEFT"
    • timeout: string | number
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • Parameters

    • source: RedisKey
    • destination: RedisKey
    • left: "LEFT"
    • right: "RIGHT"
    • timeout: string | number
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • Parameters

    • source: RedisKey
    • destination: RedisKey
    • right: "RIGHT"
    • left: "LEFT"
    • timeout: string | number
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • Parameters

    • source: RedisKey
    • destination: RedisKey
    • right: "RIGHT"
    • right1: "RIGHT"
    • timeout: string | number
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", callback: Callback<[key: string, members: string[]]>]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", callback: Callback<[key: string, members: string[]]>]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT"]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT"]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", callback: Callback<[key: string, members: string[]]>]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", callback: Callback<[key: string, members: string[]]>]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT"]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT"]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number]): Promise<[key: string, members: string[]]>
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number]): Promise<[key: string, members: string[]]>
  • Pop elements from a list, or block until one is available

    • group: list
    • complexity: O(N+M) where N is the number of provided keys and M is the number of elements returned.
    • since: 7.0.0

    Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", callback: Callback<[key: string, members: string[]]>]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", callback: Callback<[key: string, members: string[]]>]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT"]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT"]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", callback: Callback<[key: string, members: string[]]>]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", callback: Callback<[key: string, members: string[]]>]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT"]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT"]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number]

    Returns Promise<[key: string, members: string[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number]

    Returns Promise<[key: string, members: string[]]>

  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", callback: Callback<[key: Buffer, members: Buffer[]]>]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", callback: Callback<[key: Buffer, members: Buffer[]]>]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT"]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT"]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number, callback: Callback<[key: Buffer, members: Buffer[]]>]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number, callback: Callback<[key: Buffer, members: Buffer[]]>]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", callback: Callback<[key: Buffer, members: Buffer[]]>]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", callback: Callback<[key: Buffer, members: Buffer[]]>]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT"]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT"]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number, callback: Callback<[key: Buffer, members: Buffer[]]>]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number, callback: Callback<[key: Buffer, members: Buffer[]]>]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number]): Promise<[key: Buffer, members: Buffer[]]>
  • blmpopBuffer(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number]): Promise<[key: Buffer, members: Buffer[]]>
  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", callback: Callback<[key: Buffer, members: Buffer[]]>]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", callback: Callback<[key: Buffer, members: Buffer[]]>]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT"]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT"]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number, callback: Callback<[key: Buffer, members: Buffer[]]>]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number, callback: Callback<[key: Buffer, members: Buffer[]]>]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", callback: Callback<[key: Buffer, members: Buffer[]]>]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", callback: Callback<[key: Buffer, members: Buffer[]]>]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT"]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT"]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number, callback: Callback<[key: Buffer, members: Buffer[]]>]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number, callback: Callback<[key: Buffer, members: Buffer[]]>]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number]

    Returns Promise<[key: Buffer, members: Buffer[]]>

  • blpop(...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[string, string]>]): Promise<[string, string]>
  • blpop(...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[string, string]>]): Promise<[string, string]>
  • blpop(...args: [...keys: RedisKey[], timeout: string | number]): Promise<[string, string]>
  • blpop(...args: [keys: RedisKey[], timeout: string | number]): Promise<[string, string]>
  • Remove and get the first element in a list, or block until one is available

    • group: list
    • complexity: O(N) where N is the number of provided keys.
    • since: 2.0.0

    Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[string, string]>]

    Returns Promise<[string, string]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[string, string]>]

    Returns Promise<[string, string]>

  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number]

    Returns Promise<[string, string]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number]

    Returns Promise<[string, string]>

  • blpopBuffer(...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[Buffer, Buffer]>]): Promise<[Buffer, Buffer]>
  • blpopBuffer(...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[Buffer, Buffer]>]): Promise<[Buffer, Buffer]>
  • blpopBuffer(...args: [...keys: RedisKey[], timeout: string | number]): Promise<[Buffer, Buffer]>
  • blpopBuffer(...args: [keys: RedisKey[], timeout: string | number]): Promise<[Buffer, Buffer]>
  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[Buffer, Buffer]>]

    Returns Promise<[Buffer, Buffer]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[Buffer, Buffer]>]

    Returns Promise<[Buffer, Buffer]>

  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number]

    Returns Promise<[Buffer, Buffer]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number]

    Returns Promise<[Buffer, Buffer]>

  • brpop(...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[string, string]>]): Promise<[string, string]>
  • brpop(...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[string, string]>]): Promise<[string, string]>
  • brpop(...args: [...keys: RedisKey[], timeout: string | number]): Promise<[string, string]>
  • brpop(...args: [keys: RedisKey[], timeout: string | number]): Promise<[string, string]>
  • Remove and get the last element in a list, or block until one is available

    • group: list
    • complexity: O(N) where N is the number of provided keys.
    • since: 2.0.0

    Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[string, string]>]

    Returns Promise<[string, string]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[string, string]>]

    Returns Promise<[string, string]>

  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number]

    Returns Promise<[string, string]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number]

    Returns Promise<[string, string]>

  • brpopBuffer(...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[Buffer, Buffer]>]): Promise<[Buffer, Buffer]>
  • brpopBuffer(...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[Buffer, Buffer]>]): Promise<[Buffer, Buffer]>
  • brpopBuffer(...args: [...keys: RedisKey[], timeout: string | number]): Promise<[Buffer, Buffer]>
  • brpopBuffer(...args: [keys: RedisKey[], timeout: string | number]): Promise<[Buffer, Buffer]>
  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[Buffer, Buffer]>]

    Returns Promise<[Buffer, Buffer]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[Buffer, Buffer]>]

    Returns Promise<[Buffer, Buffer]>

  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number]

    Returns Promise<[Buffer, Buffer]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number]

    Returns Promise<[Buffer, Buffer]>

  • brpoplpush(source: RedisKey, destination: RedisKey, timeout: string | number, callback?: Callback<string>): Promise<string>
  • Pop an element from a list, push it to another list and return it; or block until one is available

    • group: list
    • complexity: O(1)
    • since: 2.2.0

    Parameters

    • source: RedisKey
    • destination: RedisKey
    • timeout: string | number
    • Optional callback: Callback<string>

    Returns Promise<string>

  • brpoplpushBuffer(source: RedisKey, destination: RedisKey, timeout: string | number, callback?: Callback<Buffer>): Promise<Buffer>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN", callback: Callback<unknown>]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN", callback: Callback<unknown>]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN"]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN"]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number, callback: Callback<unknown>]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number, callback: Callback<unknown>]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX", callback: Callback<unknown>]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX", callback: Callback<unknown>]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX"]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX"]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number, callback: Callback<unknown>]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number, callback: Callback<unknown>]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number]): Promise<unknown>
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number]): Promise<unknown>
  • Remove and return members with scores in a sorted set or block until one is available

    • group: sorted-set
    • complexity: O(K) + O(N*log(M)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped.
    • since: 7.0.0

    Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN", callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN", callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN"]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN"]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number, callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number, callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX", callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX", callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX"]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX"]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number, callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number, callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number]

    Returns Promise<unknown>

  • bzpopmax(...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[key: string, member: string, score: string]>]): Promise<[key: string, member: string, score: string]>
  • bzpopmax(...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[key: string, member: string, score: string]>]): Promise<[key: string, member: string, score: string]>
  • bzpopmax(...args: [...keys: RedisKey[], timeout: string | number]): Promise<[key: string, member: string, score: string]>
  • bzpopmax(...args: [keys: RedisKey[], timeout: string | number]): Promise<[key: string, member: string, score: string]>
  • Remove and return the member with the highest score from one or more sorted sets, or block until one is available

    • group: sorted-set
    • complexity: O(log(N)) with N being the number of elements in the sorted set.
    • since: 5.0.0

    Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[key: string, member: string, score: string]>]

    Returns Promise<[key: string, member: string, score: string]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[key: string, member: string, score: string]>]

    Returns Promise<[key: string, member: string, score: string]>

  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number]

    Returns Promise<[key: string, member: string, score: string]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number]

    Returns Promise<[key: string, member: string, score: string]>

  • bzpopmaxBuffer(...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[key: Buffer, member: Buffer, score: Buffer]>]): Promise<[key: Buffer, member: Buffer, score: Buffer]>
  • bzpopmaxBuffer(...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[key: Buffer, member: Buffer, score: Buffer]>]): Promise<[key: Buffer, member: Buffer, score: Buffer]>
  • bzpopmaxBuffer(...args: [...keys: RedisKey[], timeout: string | number]): Promise<[key: Buffer, member: Buffer, score: Buffer]>
  • bzpopmaxBuffer(...args: [keys: RedisKey[], timeout: string | number]): Promise<[key: Buffer, member: Buffer, score: Buffer]>
  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[key: Buffer, member: Buffer, score: Buffer]>]

    Returns Promise<[key: Buffer, member: Buffer, score: Buffer]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[key: Buffer, member: Buffer, score: Buffer]>]

    Returns Promise<[key: Buffer, member: Buffer, score: Buffer]>

  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number]

    Returns Promise<[key: Buffer, member: Buffer, score: Buffer]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number]

    Returns Promise<[key: Buffer, member: Buffer, score: Buffer]>

  • bzpopmin(...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[key: string, member: string, score: string]>]): Promise<[key: string, member: string, score: string]>
  • bzpopmin(...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[key: string, member: string, score: string]>]): Promise<[key: string, member: string, score: string]>
  • bzpopmin(...args: [...keys: RedisKey[], timeout: string | number]): Promise<[key: string, member: string, score: string]>
  • bzpopmin(...args: [keys: RedisKey[], timeout: string | number]): Promise<[key: string, member: string, score: string]>
  • Remove and return the member with the lowest score from one or more sorted sets, or block until one is available

    • group: sorted-set
    • complexity: O(log(N)) with N being the number of elements in the sorted set.
    • since: 5.0.0

    Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[key: string, member: string, score: string]>]

    Returns Promise<[key: string, member: string, score: string]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[key: string, member: string, score: string]>]

    Returns Promise<[key: string, member: string, score: string]>

  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number]

    Returns Promise<[key: string, member: string, score: string]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number]

    Returns Promise<[key: string, member: string, score: string]>

  • bzpopminBuffer(...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[key: Buffer, member: Buffer, score: Buffer]>]): Promise<[key: Buffer, member: Buffer, score: Buffer]>
  • bzpopminBuffer(...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[key: Buffer, member: Buffer, score: Buffer]>]): Promise<[key: Buffer, member: Buffer, score: Buffer]>
  • bzpopminBuffer(...args: [...keys: RedisKey[], timeout: string | number]): Promise<[key: Buffer, member: Buffer, score: Buffer]>
  • bzpopminBuffer(...args: [keys: RedisKey[], timeout: string | number]): Promise<[key: Buffer, member: Buffer, score: Buffer]>
  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number, callback: Callback<[key: Buffer, member: Buffer, score: Buffer]>]

    Returns Promise<[key: Buffer, member: Buffer, score: Buffer]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number, callback: Callback<[key: Buffer, member: Buffer, score: Buffer]>]

    Returns Promise<[key: Buffer, member: Buffer, score: Buffer]>

  • Parameters

    • Rest ...args: [...keys: RedisKey[], timeout: string | number]

    Returns Promise<[key: Buffer, member: Buffer, score: Buffer]>

  • Parameters

    • Rest ...args: [keys: RedisKey[], timeout: string | number]

    Returns Promise<[key: Buffer, member: Buffer, score: Buffer]>

  • call(command: string, callback?: Callback<unknown>): Promise<unknown>
  • call(command: string, args: (string | number | Buffer)[], callback?: Callback<unknown>): Promise<unknown>
  • call(...args: [command: string, ...args: (string | number | Buffer)[], callback: Callback<unknown>]): Promise<unknown>
  • call(...args: [command: string, ...args: (string | number | Buffer)[]]): Promise<unknown>
  • Call arbitrary commands.

    redis.call('set', 'foo', 'bar') is the same as redis.set('foo', 'bar'), so the only case you need to use this method is when the command is not supported by ioredis.

    redis.call('set', 'foo', 'bar');
    redis.call('get', 'foo', (err, value) => {
    // value === 'bar'
    });

    Parameters

    • command: string
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • command: string
    • args: (string | number | Buffer)[]
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [command: string, ...args: (string | number | Buffer)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [command: string, ...args: (string | number | Buffer)[]]

    Returns Promise<unknown>

  • callBuffer(command: string, callback?: Callback<unknown>): Promise<unknown>
  • callBuffer(command: string, args: (string | number | Buffer)[], callback?: Callback<unknown>): Promise<unknown>
  • callBuffer(...args: [command: string, ...args: (string | number | Buffer)[], callback: Callback<unknown>]): Promise<unknown>
  • callBuffer(...args: [command: string, ...args: (string | number | Buffer)[]]): Promise<unknown>
  • Parameters

    • command: string
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • command: string
    • args: (string | number | Buffer)[]
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [command: string, ...args: (string | number | Buffer)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [command: string, ...args: (string | number | Buffer)[]]

    Returns Promise<unknown>

  • client(subcommand: "CACHING", yes: "YES", callback?: Callback<"OK">): Promise<"OK">
  • client(subcommand: "CACHING", no: "NO", callback?: Callback<"OK">): Promise<"OK">
  • client(subcommand: "GETNAME", callback?: Callback<string>): Promise<string>
  • client(subcommand: "GETREDIR", callback?: Callback<number>): Promise<number>
  • client(subcommand: "HELP", callback?: Callback<unknown>): Promise<unknown>
  • client(subcommand: "ID", callback?: Callback<number>): Promise<number>
  • client(subcommand: "INFO", callback?: Callback<string>): Promise<string>
  • client(...args: [subcommand: "KILL", ...args: RedisValue[], callback: Callback<unknown>]): Promise<unknown>
  • client(...args: [subcommand: "KILL", ...args: RedisValue[]]): Promise<unknown>
  • client(subcommand: "LIST", callback?: Callback<unknown>): Promise<unknown>
  • client(...args: [subcommand: "LIST", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]): Promise<unknown>
  • client(...args: [subcommand: "LIST", idToken: "ID", ...clientIds: (string | number)[]]): Promise<unknown>
  • client(subcommand: "LIST", type: "TYPE", normal: "NORMAL", callback?: Callback<unknown>): Promise<unknown>
  • client(...args: [subcommand: "LIST", type: "TYPE", normal: "NORMAL", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]): Promise<unknown>
  • client(...args: [subcommand: "LIST", type: "TYPE", normal: "NORMAL", idToken: "ID", ...clientIds: (string | number)[]]): Promise<unknown>
  • client(subcommand: "LIST", type: "TYPE", master: "MASTER", callback?: Callback<unknown>): Promise<unknown>
  • client(...args: [subcommand: "LIST", type: "TYPE", master: "MASTER", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]): Promise<unknown>
  • client(...args: [subcommand: "LIST", type: "TYPE", master: "MASTER", idToken: "ID", ...clientIds: (string | number)[]]): Promise<unknown>
  • client(subcommand: "LIST", type: "TYPE", replica: "REPLICA", callback?: Callback<unknown>): Promise<unknown>
  • client(...args: [subcommand: "LIST", type: "TYPE", replica: "REPLICA", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]): Promise<unknown>
  • client(...args: [subcommand: "LIST", type: "TYPE", replica: "REPLICA", idToken: "ID", ...clientIds: (string | number)[]]): Promise<unknown>
  • client(subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", callback?: Callback<unknown>): Promise<unknown>
  • client(...args: [subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]): Promise<unknown>
  • client(...args: [subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", idToken: "ID", ...clientIds: (string | number)[]]): Promise<unknown>
  • client(subcommand: "NO-EVICT", on: "ON", callback?: Callback<unknown>): Promise<unknown>
  • client(subcommand: "NO-EVICT", off: "OFF", callback?: Callback<unknown>): Promise<unknown>
  • client(subcommand: "PAUSE", timeout: string | number, callback?: Callback<"OK">): Promise<"OK">
  • client(subcommand: "PAUSE", timeout: string | number, write: "WRITE", callback?: Callback<"OK">): Promise<"OK">
  • client(subcommand: "PAUSE", timeout: string | number, all: "ALL", callback?: Callback<"OK">): Promise<"OK">
  • client(subcommand: "REPLY", on: "ON", callback?: Callback<unknown>): Promise<unknown>
  • client(subcommand: "REPLY", off: "OFF", callback?: Callback<unknown>): Promise<unknown>
  • client(subcommand: "REPLY", skip: "SKIP", callback?: Callback<unknown>): Promise<unknown>
  • client(subcommand: "SETNAME", connectionName: string | Buffer, callback?: Callback<"OK">): Promise<"OK">
  • client(...args: [subcommand: "TRACKING", ...args: RedisValue[], callback: Callback<unknown>]): Promise<unknown>
  • client(...args: [subcommand: "TRACKING", ...args: RedisValue[]]): Promise<unknown>
  • client(subcommand: "TRACKINGINFO", callback?: Callback<string>): Promise<string>
  • client(subcommand: "UNBLOCK", clientId: string | number, callback?: Callback<unknown>): Promise<unknown>
  • client(subcommand: "UNBLOCK", clientId: string | number, timeout: "TIMEOUT", callback?: Callback<unknown>): Promise<unknown>
  • client(subcommand: "UNBLOCK", clientId: string | number, error: "ERROR", callback?: Callback<unknown>): Promise<unknown>
  • client(subcommand: "UNPAUSE", callback?: Callback<"OK">): Promise<"OK">
  • Instruct the server about tracking or not keys in the next request

    • group: connection
    • complexity: O(1)
    • since: 6.0.0

    Parameters

    • subcommand: "CACHING"
    • yes: "YES"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • subcommand: "CACHING"
    • no: "NO"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Get the current connection name

    • group: connection
    • complexity: O(1)
    • since: 2.6.9

    Parameters

    • subcommand: "GETNAME"
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Get tracking notifications redirection client ID if any

    • group: connection
    • complexity: O(1)
    • since: 6.0.0

    Parameters

    • subcommand: "GETREDIR"
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Show helpful text about the different subcommands

    • group: connection
    • complexity: O(1)
    • since: 5.0.0

    Parameters

    • subcommand: "HELP"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Returns the client ID for the current connection

    • group: connection
    • complexity: O(1)
    • since: 5.0.0

    Parameters

    • subcommand: "ID"
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Returns information about the current client connection.

    • group: connection
    • complexity: O(1)
    • since: 6.2.0

    Parameters

    • subcommand: "INFO"
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Kill the connection of a client

    • group: connection
    • complexity: O(N) where N is the number of client connections
    • since: 2.4.0

    Parameters

    • Rest ...args: [subcommand: "KILL", ...args: RedisValue[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "KILL", ...args: RedisValue[]]

    Returns Promise<unknown>

  • Get the list of client connections

    • group: connection
    • complexity: O(N) where N is the number of client connections
    • since: 2.4.0

    Parameters

    • subcommand: "LIST"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "LIST", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "LIST", idToken: "ID", ...clientIds: (string | number)[]]

    Returns Promise<unknown>

  • Parameters

    • subcommand: "LIST"
    • type: "TYPE"
    • normal: "NORMAL"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "LIST", type: "TYPE", normal: "NORMAL", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "LIST", type: "TYPE", normal: "NORMAL", idToken: "ID", ...clientIds: (string | number)[]]

    Returns Promise<unknown>

  • Parameters

    • subcommand: "LIST"
    • type: "TYPE"
    • master: "MASTER"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "LIST", type: "TYPE", master: "MASTER", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "LIST", type: "TYPE", master: "MASTER", idToken: "ID", ...clientIds: (string | number)[]]

    Returns Promise<unknown>

  • Parameters

    • subcommand: "LIST"
    • type: "TYPE"
    • replica: "REPLICA"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "LIST", type: "TYPE", replica: "REPLICA", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "LIST", type: "TYPE", replica: "REPLICA", idToken: "ID", ...clientIds: (string | number)[]]

    Returns Promise<unknown>

  • Parameters

    • subcommand: "LIST"
    • type: "TYPE"
    • pubsub: "PUBSUB"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", idToken: "ID", ...clientIds: (string | number)[]]

    Returns Promise<unknown>

  • Set client eviction mode for the current connection

    • group: connection
    • complexity: O(1)
    • since: 7.0.0

    Parameters

    • subcommand: "NO-EVICT"
    • on: "ON"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • subcommand: "NO-EVICT"
    • off: "OFF"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Stop processing commands from clients for some time

    • group: connection
    • complexity: O(1)
    • since: 2.9.50

    Parameters

    • subcommand: "PAUSE"
    • timeout: string | number
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • subcommand: "PAUSE"
    • timeout: string | number
    • write: "WRITE"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • subcommand: "PAUSE"
    • timeout: string | number
    • all: "ALL"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Instruct the server whether to reply to commands

    • group: connection
    • complexity: O(1)
    • since: 3.2.0

    Parameters

    • subcommand: "REPLY"
    • on: "ON"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • subcommand: "REPLY"
    • off: "OFF"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • subcommand: "REPLY"
    • skip: "SKIP"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Set the current connection name

    • group: connection
    • complexity: O(1)
    • since: 2.6.9

    Parameters

    • subcommand: "SETNAME"
    • connectionName: string | Buffer
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Enable or disable server assisted client side caching support

    • group: connection
    • complexity: O(1). Some options may introduce additional complexity.
    • since: 6.0.0

    Parameters

    • Rest ...args: [subcommand: "TRACKING", ...args: RedisValue[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "TRACKING", ...args: RedisValue[]]

    Returns Promise<unknown>

  • Return information about server assisted client side caching for the current connection

    • group: connection
    • complexity: O(1)
    • since: 6.2.0

    Parameters

    • subcommand: "TRACKINGINFO"
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Unblock a client blocked in a blocking command from a different connection

    • group: connection
    • complexity: O(log N) where N is the number of client connections
    • since: 5.0.0

    Parameters

    • subcommand: "UNBLOCK"
    • clientId: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • subcommand: "UNBLOCK"
    • clientId: string | number
    • timeout: "TIMEOUT"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • subcommand: "UNBLOCK"
    • clientId: string | number
    • error: "ERROR"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Resume processing of clients that were paused

    • group: connection
    • complexity: O(N) Where N is the number of paused clients
    • since: 6.2.0

    Parameters

    • subcommand: "UNPAUSE"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • clientBuffer(subcommand: "GETNAME", callback?: Callback<Buffer>): Promise<Buffer>
  • clientBuffer(subcommand: "INFO", callback?: Callback<Buffer>): Promise<Buffer>
  • clientBuffer(subcommand: "TRACKINGINFO", callback?: Callback<Buffer>): Promise<Buffer>
  • Parameters

    • subcommand: "GETNAME"
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • Parameters

    • subcommand: "INFO"
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • Parameters

    • subcommand: "TRACKINGINFO"
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • cluster(...args: [subcommand: "ADDSLOTS", ...slots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(...args: [subcommand: "ADDSLOTS", slots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(...args: [subcommand: "ADDSLOTS", ...slots: (string | number)[]]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(...args: [subcommand: "ADDSLOTS", slots: (string | number)[]]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(...args: [subcommand: "ADDSLOTSRANGE", ...startSlotEndSlots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(...args: [subcommand: "ADDSLOTSRANGE", ...startSlotEndSlots: (string | number)[]]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(subcommand: "BUMPEPOCH", callback?: Callback<"BUMPED" | "STILL">): Promise<"BUMPED" | "STILL">
  • cluster(subcommand: "COUNT-FAILURE-REPORTS", nodeId: string | number | Buffer, callback?: Callback<number>): Promise<number>
  • cluster(subcommand: "COUNTKEYSINSLOT", slot: string | number, callback?: Callback<number>): Promise<number>
  • cluster(...args: [subcommand: "DELSLOTS", ...slots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(...args: [subcommand: "DELSLOTS", slots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(...args: [subcommand: "DELSLOTS", ...slots: (string | number)[]]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(...args: [subcommand: "DELSLOTS", slots: (string | number)[]]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(...args: [subcommand: "DELSLOTSRANGE", ...startSlotEndSlots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(...args: [subcommand: "DELSLOTSRANGE", ...startSlotEndSlots: (string | number)[]]): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(subcommand: "FAILOVER", callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "FAILOVER", force: "FORCE", callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "FAILOVER", takeover: "TAKEOVER", callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "FLUSHSLOTS", callback?: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • cluster(subcommand: "FORGET", nodeId: string | number | Buffer, callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "GETKEYSINSLOT", slot: string | number, count: string | number, callback?: Callback<string[]>): Promise<string[]>
  • cluster(subcommand: "HELP", callback?: Callback<unknown>): Promise<unknown>
  • cluster(subcommand: "INFO", callback?: Callback<string>): Promise<string>
  • cluster(subcommand: "KEYSLOT", key: string | Buffer, callback?: Callback<number>): Promise<number>
  • cluster(subcommand: "LINKS", callback?: Callback<unknown[]>): Promise<unknown[]>
  • cluster(subcommand: "MEET", ip: string | Buffer, port: string | number, callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "MYID", callback?: Callback<string>): Promise<string>
  • cluster(subcommand: "NODES", callback?: Callback<unknown>): Promise<unknown>
  • cluster(subcommand: "REPLICAS", nodeId: string | number | Buffer, callback?: Callback<unknown>): Promise<unknown>
  • cluster(subcommand: "REPLICATE", nodeId: string | number | Buffer, callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "RESET", callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "RESET", hard: "HARD", callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "RESET", soft: "SOFT", callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "SAVECONFIG", callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "SET-CONFIG-EPOCH", configEpoch: string | number, callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "SETSLOT", slot: string | number, nodeIdToken: "IMPORTING", nodeId: string | number | Buffer, callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "SETSLOT", slot: string | number, nodeIdToken: "MIGRATING", nodeId: string | number | Buffer, callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "SETSLOT", slot: string | number, nodeIdToken: "NODE", nodeId: string | number | Buffer, callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "SETSLOT", slot: string | number, stable: "STABLE", callback?: Callback<"OK">): Promise<"OK">
  • cluster(subcommand: "SHARDS", callback?: Callback<unknown>): Promise<unknown>
  • cluster(subcommand: "SLAVES", nodeId: string | number | Buffer, callback?: Callback<unknown>): Promise<unknown>
  • cluster(subcommand: "SLOTS", callback?: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>): Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>
  • Assign new hash slots to receiving node

    • group: cluster
    • complexity: O(N) where N is the total number of hash slot arguments
    • since: 3.0.0

    Parameters

    • Rest ...args: [subcommand: "ADDSLOTS", ...slots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Parameters

    • Rest ...args: [subcommand: "ADDSLOTS", slots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Parameters

    • Rest ...args: [subcommand: "ADDSLOTS", ...slots: (string | number)[]]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Parameters

    • Rest ...args: [subcommand: "ADDSLOTS", slots: (string | number)[]]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Assign new hash slots to receiving node

    • group: cluster
    • complexity: O(N) where N is the total number of the slots between the start slot and end slot arguments.
    • since: 7.0.0

    Parameters

    • Rest ...args: [subcommand: "ADDSLOTSRANGE", ...startSlotEndSlots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Parameters

    • Rest ...args: [subcommand: "ADDSLOTSRANGE", ...startSlotEndSlots: (string | number)[]]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Advance the cluster config epoch

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "BUMPEPOCH"
    • Optional callback: Callback<"BUMPED" | "STILL">

    Returns Promise<"BUMPED" | "STILL">

  • Return the number of failure reports active for a given node

    • group: cluster
    • complexity: O(N) where N is the number of failure reports
    • since: 3.0.0

    Parameters

    • subcommand: "COUNT-FAILURE-REPORTS"
    • nodeId: string | number | Buffer
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Return the number of local keys in the specified hash slot

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "COUNTKEYSINSLOT"
    • slot: string | number
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Set hash slots as unbound in receiving node

    • group: cluster
    • complexity: O(N) where N is the total number of hash slot arguments
    • since: 3.0.0

    Parameters

    • Rest ...args: [subcommand: "DELSLOTS", ...slots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Parameters

    • Rest ...args: [subcommand: "DELSLOTS", slots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Parameters

    • Rest ...args: [subcommand: "DELSLOTS", ...slots: (string | number)[]]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Parameters

    • Rest ...args: [subcommand: "DELSLOTS", slots: (string | number)[]]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Set hash slots as unbound in receiving node

    • group: cluster
    • complexity: O(N) where N is the total number of the slots between the start slot and end slot arguments.
    • since: 7.0.0

    Parameters

    • Rest ...args: [subcommand: "DELSLOTSRANGE", ...startSlotEndSlots: (string | number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Parameters

    • Rest ...args: [subcommand: "DELSLOTSRANGE", ...startSlotEndSlots: (string | number)[]]

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Forces a replica to perform a manual failover of its master.

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "FAILOVER"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • subcommand: "FAILOVER"
    • force: "FORCE"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • subcommand: "FAILOVER"
    • takeover: "TAKEOVER"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Delete a node's own slots information

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "FLUSHSLOTS"
    • Optional callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • Remove a node from the nodes table

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "FORGET"
    • nodeId: string | number | Buffer
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Return local key names in the specified hash slot

    • group: cluster
    • complexity: O(log(N)) where N is the number of requested keys
    • since: 3.0.0

    Parameters

    • subcommand: "GETKEYSINSLOT"
    • slot: string | number
    • count: string | number
    • Optional callback: Callback<string[]>

    Returns Promise<string[]>

  • Show helpful text about the different subcommands

    • group: cluster
    • complexity: O(1)
    • since: 5.0.0

    Parameters

    • subcommand: "HELP"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Provides info about Redis Cluster node state

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "INFO"
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Returns the hash slot of the specified key

    • group: cluster
    • complexity: O(N) where N is the number of bytes in the key
    • since: 3.0.0

    Parameters

    • subcommand: "KEYSLOT"
    • key: string | Buffer
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Returns a list of all TCP links to and from peer nodes in cluster

    • group: cluster
    • complexity: O(N) where N is the total number of Cluster nodes
    • since: 7.0.0

    Parameters

    • subcommand: "LINKS"
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • Force a node cluster to handshake with another node

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "MEET"
    • ip: string | Buffer
    • port: string | number
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Return the node id

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "MYID"
    • Optional callback: Callback<string>

    Returns Promise<string>

  • Get Cluster config for the node

    • group: cluster
    • complexity: O(N) where N is the total number of Cluster nodes
    • since: 3.0.0

    Parameters

    • subcommand: "NODES"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • List replica nodes of the specified master node

    • group: cluster
    • complexity: O(1)
    • since: 5.0.0

    Parameters

    • subcommand: "REPLICAS"
    • nodeId: string | number | Buffer
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Reconfigure a node as a replica of the specified master node

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "REPLICATE"
    • nodeId: string | number | Buffer
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Reset a Redis Cluster node

    • group: cluster
    • complexity: O(N) where N is the number of known nodes. The command may execute a FLUSHALL as a side effect.
    • since: 3.0.0

    Parameters

    • subcommand: "RESET"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • subcommand: "RESET"
    • hard: "HARD"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • subcommand: "RESET"
    • soft: "SOFT"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Forces the node to save cluster state on disk

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "SAVECONFIG"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Set the configuration epoch in a new node

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "SET-CONFIG-EPOCH"
    • configEpoch: string | number
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Bind a hash slot to a specific node

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "SETSLOT"
    • slot: string | number
    • nodeIdToken: "IMPORTING"
    • nodeId: string | number | Buffer
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • subcommand: "SETSLOT"
    • slot: string | number
    • nodeIdToken: "MIGRATING"
    • nodeId: string | number | Buffer
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • subcommand: "SETSLOT"
    • slot: string | number
    • nodeIdToken: "NODE"
    • nodeId: string | number | Buffer
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Parameters

    • subcommand: "SETSLOT"
    • slot: string | number
    • stable: "STABLE"
    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • Get array of cluster slots to node mappings

    • group: cluster
    • complexity: O(N) where N is the total number of cluster nodes
    • since: 7.0.0

    Parameters

    • subcommand: "SHARDS"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • List replica nodes of the specified master node

    • group: cluster
    • complexity: O(1)
    • since: 3.0.0

    Parameters

    • subcommand: "SLAVES"
    • nodeId: string | number | Buffer
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Get array of Cluster slot to node mappings

    • group: cluster
    • complexity: O(N) where N is the total number of Cluster nodes
    • since: 3.0.0

    Parameters

    • subcommand: "SLOTS"
    • Optional callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

    Returns Promise<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>

  • command(subcommand: "COUNT", callback?: Callback<unknown[]>): Promise<unknown[]>
  • command(subcommand: "DOCS", callback?: Callback<unknown[]>): Promise<unknown[]>
  • command(...args: [subcommand: "DOCS", ...commandNames: (string | Buffer)[], callback: Callback<unknown[]>]): Promise<unknown[]>
  • command(...args: [subcommand: "DOCS", ...commandNames: (string | Buffer)[]]): Promise<unknown[]>
  • command(subcommand: "GETKEYS", callback?: Callback<unknown[]>): Promise<unknown[]>
  • command(subcommand: "GETKEYSANDFLAGS", callback?: Callback<unknown[]>): Promise<unknown[]>
  • command(subcommand: "HELP", callback?: Callback<unknown[]>): Promise<unknown[]>
  • command(subcommand: "INFO", callback?: Callback<unknown[]>): Promise<unknown[]>
  • command(...args: [subcommand: "INFO", ...commandNames: (string | Buffer)[], callback: Callback<unknown[]>]): Promise<unknown[]>
  • command(...args: [subcommand: "INFO", ...commandNames: (string | Buffer)[]]): Promise<unknown[]>
  • command(subcommand: "LIST", callback?: Callback<unknown[]>): Promise<unknown[]>
  • command(subcommand: "LIST", filterby: "FILTERBY", moduleNameToken: "MODULE", moduleName: string | Buffer, callback?: Callback<unknown[]>): Promise<unknown[]>
  • command(subcommand: "LIST", filterby: "FILTERBY", categoryToken: "ACLCAT", category: string | Buffer, callback?: Callback<unknown[]>): Promise<unknown[]>
  • command(subcommand: "LIST", filterby: "FILTERBY", patternToken: "PATTERN", pattern: string, callback?: Callback<unknown[]>): Promise<unknown[]>
  • Get total number of Redis commands

    • group: server
    • complexity: O(1)
    • since: 2.8.13

    Parameters

    • subcommand: "COUNT"
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • Get array of specific Redis command documentation

    • group: server
    • complexity: O(N) where N is the number of commands to look up
    • since: 7.0.0

    Parameters

    • subcommand: "DOCS"
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • Parameters

    • Rest ...args: [subcommand: "DOCS", ...commandNames: (string | Buffer)[], callback: Callback<unknown[]>]

    Returns Promise<unknown[]>

  • Parameters

    • Rest ...args: [subcommand: "DOCS", ...commandNames: (string | Buffer)[]]

    Returns Promise<unknown[]>

  • Extract keys given a full Redis command

    • group: server
    • complexity: O(N) where N is the number of arguments to the command
    • since: 2.8.13

    Parameters

    • subcommand: "GETKEYS"
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • Extract keys and access flags given a full Redis command

    • group: server
    • complexity: O(N) where N is the number of arguments to the command
    • since: 7.0.0

    Parameters

    • subcommand: "GETKEYSANDFLAGS"
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • Show helpful text about the different subcommands

    • group: server
    • complexity: O(1)
    • since: 5.0.0

    Parameters

    • subcommand: "HELP"
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • Get array of specific Redis command details, or all when no argument is given.

    • group: server
    • complexity: O(N) where N is the number of commands to look up
    • since: 2.8.13

    Parameters

    • subcommand: "INFO"
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • Parameters

    • Rest ...args: [subcommand: "INFO", ...commandNames: (string | Buffer)[], callback: Callback<unknown[]>]

    Returns Promise<unknown[]>

  • Parameters

    • Rest ...args: [subcommand: "INFO", ...commandNames: (string | Buffer)[]]

    Returns Promise<unknown[]>

  • Get an array of Redis command names

    • group: server
    • complexity: O(N) where N is the total number of Redis commands
    • since: 7.0.0

    Parameters

    • subcommand: "LIST"
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • Parameters

    • subcommand: "LIST"
    • filterby: "FILTERBY"
    • moduleNameToken: "MODULE"
    • moduleName: string | Buffer
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • Parameters

    • subcommand: "LIST"
    • filterby: "FILTERBY"
    • categoryToken: "ACLCAT"
    • category: string | Buffer
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • Parameters

    • subcommand: "LIST"
    • filterby: "FILTERBY"
    • patternToken: "PATTERN"
    • pattern: string
    • Optional callback: Callback<unknown[]>

    Returns Promise<unknown[]>

  • config(...args: [subcommand: "GET", ...parameters: (string | Buffer)[], callback: Callback<unknown>]): Promise<unknown>
  • config(...args: [subcommand: "GET", ...parameters: (string | Buffer)[]]): Promise<unknown>
  • config(subcommand: "HELP", callback?: Callback<unknown>): Promise<unknown>
  • config(subcommand: "RESETSTAT", callback?: Callback<unknown>): Promise<unknown>
  • config(subcommand: "REWRITE", callback?: Callback<unknown>): Promise<unknown>
  • config(...args: [subcommand: "SET", ...parameterValues: (string | number | Buffer)[], callback: Callback<unknown>]): Promise<unknown>
  • config(...args: [subcommand: "SET", ...parameterValues: (string | number | Buffer)[]]): Promise<unknown>
  • Get the values of configuration parameters

    • group: server
    • complexity: O(N) when N is the number of configuration parameters provided
    • since: 2.0.0

    Parameters

    • Rest ...args: [subcommand: "GET", ...parameters: (string | Buffer)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "GET", ...parameters: (string | Buffer)[]]

    Returns Promise<unknown>

  • Show helpful text about the different subcommands

    • group: server
    • complexity: O(1)
    • since: 5.0.0

    Parameters

    • subcommand: "HELP"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Reset the stats returned by INFO

    • group: server
    • complexity: O(1)
    • since: 2.0.0

    Parameters

    • subcommand: "RESETSTAT"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Rewrite the configuration file with the in memory configuration

    • group: server
    • complexity: O(1)
    • since: 2.8.0

    Parameters

    • subcommand: "REWRITE"
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Set configuration parameters to the given values

    • group: server
    • complexity: O(N) when N is the number of configuration parameters provided
    • since: 2.0.0

    Parameters

    • Rest ...args: [subcommand: "SET", ...parameterValues: (string | number | Buffer)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: "SET", ...parameterValues: (string | number | Buffer)[]]

    Returns Promise<unknown>

  • connect(callback?: Callback<void>): Promise<void>
  • Create a connection to Redis. This method will be invoked automatically when creating a new Redis instance unless lazyConnect: true is passed.

    When calling this method manually, a Promise is returned, which will be resolved when the connection status is ready.

    Parameters

    • Optional callback: Callback<void>

    Returns Promise<void>

  • copy(source: RedisKey, destination: RedisKey, callback?: Callback<number>): Promise<number>
  • copy(source: RedisKey, destination: RedisKey, replace: "REPLACE", callback?: Callback<number>): Promise<number>
  • copy(source: RedisKey, destination: RedisKey, destinationDbToken: "DB", destinationDb: string | number, callback?: Callback<number>): Promise<number>
  • copy(source: RedisKey, destination: RedisKey, destinationDbToken: "DB", destinationDb: string | number, replace: "REPLACE", callback?: Callback<number>): Promise<number>
  • Copy a key

    • group: generic
    • complexity: O(N) worst case for collections, where N is the number of nested items. O(1) for string values.
    • since: 6.2.0

    Parameters

    Returns Promise<number>

  • Parameters

    • source: RedisKey
    • destination: RedisKey
    • replace: "REPLACE"
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Parameters

    • source: RedisKey
    • destination: RedisKey
    • destinationDbToken: "DB"
    • destinationDb: string | number
    • Optional callback: Callback<number>

    Returns Promise<number>

  • Parameters

    • source: RedisKey
    • destination: RedisKey
    • destinationDbToken: "DB"
    • destinationDb: string | number
    • replace: "REPLACE"
    • Optional callback: Callback<number>

    Returns Promise<number>

  • createBuiltinCommand(commandName: string): { buffer: any; string: any }
  • Create a builtin command

    Parameters

    • commandName: string

    Returns { buffer: any; string: any }

    • buffer: any
    • string: any
  • dbsize(callback?: Callback<number>): Promise<number>
  • Return the number of keys in the selected database

    • group: server
    • complexity: O(1)
    • since: 1.0.0

    Parameters

    • Optional callback: Callback<number>

    Returns Promise<number>

  • debug(subcommand: string, callback?: Callback<unknown>): Promise<unknown>
  • debug(...args: [subcommand: string, ...args: (string | number | Buffer)[], callback: Callback<unknown>]): Promise<unknown>
  • debug(...args: [subcommand: string, ...args: (string | number | Buffer)[]]): Promise<unknown>
  • A container for debugging commands

    • group: server
    • complexity: Depends on subcommand.
    • since: 1.0.0

    Parameters

    • subcommand: string
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: string, ...args: (string | number | Buffer)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [subcommand: string, ...args: (string | number | Buffer)[]]

    Returns Promise<unknown>

  • decr(key: RedisKey, callback?: Callback<number>): Promise<number>
  • Decrement the integer value of a key by one

    • group: string
    • complexity: O(1)
    • since: 1.0.0

    Parameters

    • key: RedisKey
    • Optional callback: Callback<number>

    Returns Promise<number>

  • decrby(key: RedisKey, decrement: string | number, callback?: Callback<number>): Promise<number>
  • Decrement the integer value of a key by the given number

    • group: string
    • complexity: O(1)
    • since: 1.0.0

    Parameters

    • key: RedisKey
    • decrement: string | number
    • Optional callback: Callback<number>

    Returns Promise<number>

  • defineCommand(name: string, definition: { lua: string; numberOfKeys?: number; readOnly?: boolean }): void
  • Define a custom command using lua script

    Parameters

    • name: string
    • definition: { lua: string; numberOfKeys?: number; readOnly?: boolean }
      • lua: string
      • Optional numberOfKeys?: number
      • Optional readOnly?: boolean

    Returns void

  • del(...args: [...keys: RedisKey[], callback: Callback<number>]): Promise<number>
  • del(...args: [keys: RedisKey[], callback: Callback<number>]): Promise<number>
  • del(...args: RedisKey[]): Promise<number>
  • del(...args: [keys: RedisKey[]]): Promise<number>
  • Delete a key

    • group: generic
    • complexity: O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1).
    • since: 1.0.0

    Parameters

    • Rest ...args: [...keys: RedisKey[], callback: Callback<number>]

    Returns Promise<number>

  • Parameters

    • Rest ...args: [keys: RedisKey[], callback: Callback<number>]

    Returns Promise<number>

  • Parameters

    Returns Promise<number>

  • Parameters

    Returns Promise<number>

  • discard(callback?: Callback<"OK">): Promise<"OK">
  • Discard all commands issued after MULTI

    • group: transactions
    • complexity: O(N), when N is the number of queued commands
    • since: 2.0.0

    Parameters

    • Optional callback: Callback<"OK">

    Returns Promise<"OK">

  • disconnect(reconnect?: boolean): void
  • Disconnect from Redis.

    This method closes the connection immediately, and may lose some pending replies that haven't written to client. If you want to wait for the pending replies, use Redis#quit instead.

    Parameters

    • reconnect: boolean = false

    Returns void

  • dump(key: RedisKey, callback?: Callback<string>): Promise<string>
  • Return a serialized version of the value stored at the specified key.

    • group: generic
    • complexity: O(1) to access the key and additional O(NM) to serialize it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1M) where M is small, so simply O(1).
    • since: 2.6.0

    Parameters

    • key: RedisKey
    • Optional callback: Callback<string>

    Returns Promise<string>

  • dumpBuffer(key: RedisKey, callback?: Callback<Buffer>): Promise<Buffer>
  • Create a new instance with the same options as the current one.

    example
    var redis = new Redis(6380);
    var anotherRedis = redis.duplicate();

    Parameters

    Returns Redis

  • echo(message: string | Buffer, callback?: Callback<string>): Promise<string>
  • Echo the given string

    • group: connection
    • complexity: O(1)
    • since: 1.0.0

    Parameters

    • message: string | Buffer
    • Optional callback: Callback<string>

    Returns Promise<string>

  • echoBuffer(message: string | Buffer, callback?: Callback<Buffer>): Promise<Buffer>
  • Parameters

    • message: string | Buffer
    • Optional callback: Callback<Buffer>

    Returns Promise<Buffer>

  • end(): void
  • Disconnect from Redis.

    deprecated

    Returns void

  • eval(script: string | Buffer, numkeys: string | number, callback?: Callback<unknown>): Promise<unknown>
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[], callback: Callback<unknown>]): Promise<unknown>
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[]]): Promise<unknown>
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...keys: RedisKey[], callback: Callback<unknown>]): Promise<unknown>
  • eval(...args: [script: string | Buffer, numkeys: string | number, keys: RedisKey[], callback: Callback<unknown>]): Promise<unknown>
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...keys: RedisKey[]]): Promise<unknown>
  • eval(...args: [script: string | Buffer, numkeys: string | number, keys: RedisKey[]]): Promise<unknown>
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...args: RedisValue[], callback: Callback<unknown>]): Promise<unknown>
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...args: RedisValue[]]): Promise<unknown>
  • Execute a Lua script server side

    • group: scripting
    • complexity: Depends on the script that is executed.
    • since: 2.6.0

    Parameters

    • script: string | Buffer
    • numkeys: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [script: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [script: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[]]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [script: string | Buffer, numkeys: string | number, ...keys: RedisKey[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [script: string | Buffer, numkeys: string | number, keys: RedisKey[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [script: string | Buffer, numkeys: string | number, ...keys: RedisKey[]]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [script: string | Buffer, numkeys: string | number, keys: RedisKey[]]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [script: string | Buffer, numkeys: string | number, ...args: RedisValue[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [script: string | Buffer, numkeys: string | number, ...args: RedisValue[]]

    Returns Promise<unknown>

  • eval_ro(...args: [script: string | Buffer, numkeys: string | number, ...args: RedisValue[], callback: Callback<unknown>]): Promise<unknown>
  • eval_ro(...args: [script: string | Buffer, numkeys: string | number, ...args: RedisValue[]]): Promise<unknown>
  • Execute a read-only Lua script server side

    • group: scripting
    • complexity: Depends on the script that is executed.
    • since: 7.0.0

    Parameters

    • Rest ...args: [script: string | Buffer, numkeys: string | number, ...args: RedisValue[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [script: string | Buffer, numkeys: string | number, ...args: RedisValue[]]

    Returns Promise<unknown>

  • evalsha(sha1: string | Buffer, numkeys: string | number, callback?: Callback<unknown>): Promise<unknown>
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[], callback: Callback<unknown>]): Promise<unknown>
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[]]): Promise<unknown>
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...keys: RedisKey[], callback: Callback<unknown>]): Promise<unknown>
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, keys: RedisKey[], callback: Callback<unknown>]): Promise<unknown>
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...keys: RedisKey[]]): Promise<unknown>
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, keys: RedisKey[]]): Promise<unknown>
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...args: RedisValue[], callback: Callback<unknown>]): Promise<unknown>
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...args: RedisValue[]]): Promise<unknown>
  • Execute a Lua script server side

    • group: scripting
    • complexity: Depends on the script that is executed.
    • since: 2.6.0

    Parameters

    • sha1: string | Buffer
    • numkeys: string | number
    • Optional callback: Callback<unknown>

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [sha1: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [sha1: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[]]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [sha1: string | Buffer, numkeys: string | number, ...keys: RedisKey[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [sha1: string | Buffer, numkeys: string | number, keys: RedisKey[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [sha1: string | Buffer, numkeys: string | number, ...keys: RedisKey[]]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [sha1: string | Buffer, numkeys: string | number, keys: RedisKey[]]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [sha1: string | Buffer, numkeys: string | number, ...args: RedisValue[], callback: Callback<unknown>]

    Returns Promise<unknown>

  • Parameters

    • Rest ...args: [sha1: string | Buffer, numkeys: string | number, ...args: RedisValue[]]

    Returns Promise<unknown>

  • evalsha_ro(...args: [sha1: string | Buffer, numkeys: string | number, ...args: RedisValue[], callback: Callback<unknown>]): Promise<unknown>
  • evalsha_ro(...args: [sha1: string | Buffer, numkeys: