Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ChainableCommander

Hierarchy

  • RedisCommander<{ type: "pipeline" }>
    • ChainableCommander

Index

Properties

Methods

Properties

length: number

Methods

  • acl(subcommand: "CAT", callback?: Callback<unknown>): ChainableCommander
  • acl(subcommand: "CAT", categoryname: string | Buffer, callback?: Callback<unknown>): ChainableCommander
  • acl(...args: [subcommand: "DELUSER", ...usernames: (string | Buffer)[], callback: Callback<number>]): ChainableCommander
  • acl(...args: [subcommand: "DELUSER", ...usernames: (string | Buffer)[]]): ChainableCommander
  • acl(subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, callback?: Callback<string>): ChainableCommander
  • acl(...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[], callback: Callback<string>]): ChainableCommander
  • acl(...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[]]): ChainableCommander
  • acl(subcommand: "GENPASS", callback?: Callback<string>): ChainableCommander
  • acl(subcommand: "GENPASS", bits: string | number, callback?: Callback<string>): ChainableCommander
  • acl(subcommand: "GETUSER", username: string | Buffer, callback?: Callback<string[]>): ChainableCommander
  • acl(subcommand: "HELP", callback?: Callback<unknown>): ChainableCommander
  • acl(subcommand: "LIST", callback?: Callback<string[]>): ChainableCommander
  • acl(subcommand: "LOAD", callback?: Callback<"OK">): ChainableCommander
  • acl(subcommand: "LOG", callback?: Callback<unknown>): ChainableCommander
  • acl(subcommand: "LOG", count: string | number, callback?: Callback<unknown>): ChainableCommander
  • acl(subcommand: "LOG", reset: "RESET", callback?: Callback<unknown>): ChainableCommander
  • acl(subcommand: "SAVE", callback?: Callback<"OK">): ChainableCommander
  • acl(subcommand: "SETUSER", username: string | Buffer, callback?: Callback<"OK">): ChainableCommander
  • acl(...args: [subcommand: "SETUSER", username: string | Buffer, ...rules: (string | Buffer)[], callback: Callback<"OK">]): ChainableCommander
  • acl(...args: [subcommand: "SETUSER", username: string | Buffer, ...rules: (string | Buffer)[]]): ChainableCommander
  • acl(subcommand: "USERS", callback?: Callback<string[]>): ChainableCommander
  • acl(subcommand: "WHOAMI", callback?: Callback<string>): ChainableCommander
  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Show helpful text about the different subcommands

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

    Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • aclBuffer(subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, callback?: Callback<Buffer>): ChainableCommander
  • aclBuffer(...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[], callback: Callback<Buffer>]): ChainableCommander
  • aclBuffer(...args: [subcommand: "DRYRUN", username: string | Buffer, command: string | Buffer, ...args: (string | number | Buffer)[]]): ChainableCommander
  • aclBuffer(subcommand: "GENPASS", callback?: Callback<Buffer>): ChainableCommander
  • aclBuffer(subcommand: "GENPASS", bits: string | number, callback?: Callback<Buffer>): ChainableCommander
  • aclBuffer(subcommand: "GETUSER", username: string | Buffer, callback?: Callback<Buffer[]>): ChainableCommander
  • aclBuffer(subcommand: "LIST", callback?: Callback<Buffer[]>): ChainableCommander
  • aclBuffer(subcommand: "USERS", callback?: Callback<Buffer[]>): ChainableCommander
  • aclBuffer(subcommand: "WHOAMI", callback?: Callback<Buffer>): ChainableCommander
  • 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 ChainableCommander

  • Sent by cluster clients after an -ASK redirect

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

    Parameters

    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • auth(password: string | Buffer, callback?: Callback<"OK">): ChainableCommander
  • auth(username: string | Buffer, password: string | Buffer, callback?: Callback<"OK">): ChainableCommander
  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Asynchronously rewrite the append-only file

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

    Parameters

    • Optional callback: Callback<string>

    Returns ChainableCommander

  • bitfield(key: RedisKey, encodingOffsetToken: "GET", encoding: string | Buffer, offset: string | number, callback?: Callback<unknown>): ChainableCommander
  • bitfield(key: RedisKey, encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: string | number, value: string | number, callback?: Callback<unknown>): ChainableCommander
  • bitfield(key: RedisKey, encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: string | number, increment: string | number, callback?: Callback<unknown>): ChainableCommander
  • bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: string | number, value: string | number, callback?: Callback<unknown>): ChainableCommander
  • bitfield(key: RedisKey, overflow: "OVERFLOW", wrap: "WRAP", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: string | number, increment: string | number, callback?: Callback<unknown>): ChainableCommander
  • bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: string | number, value: string | number, callback?: Callback<unknown>): ChainableCommander
  • bitfield(key: RedisKey, overflow: "OVERFLOW", sat: "SAT", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: string | number, increment: string | number, callback?: Callback<unknown>): ChainableCommander
  • bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", encodingOffsetValueToken: "SET", encoding: string | Buffer, offset: string | number, value: string | number, callback?: Callback<unknown>): ChainableCommander
  • bitfield(key: RedisKey, overflow: "OVERFLOW", fail: "FAIL", encodingOffsetIncrementToken: "INCRBY", encoding: string | Buffer, offset: string | number, increment: string | number, callback?: Callback<unknown>): ChainableCommander
  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • bitfield_ro(...args: [key: RedisKey, encodingOffsetToken: "GET", ...encodingOffsets: (string | number | Buffer)[], callback: Callback<unknown[]>]): ChainableCommander
  • bitfield_ro(...args: [key: RedisKey, encodingOffsetToken: "GET", ...encodingOffsets: (string | number | Buffer)[]]): ChainableCommander
  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", callback: Callback<[key: string, members: string[]]>]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", callback: Callback<[key: string, members: string[]]>]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT"]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT"]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], left: "LEFT", countToken: "COUNT", count: string | number]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", callback: Callback<[key: string, members: string[]]>]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", callback: Callback<[key: string, members: string[]]>]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT"]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT"]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number, callback: Callback<[key: string, members: string[]]>]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number]): ChainableCommander
  • blmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], right: "RIGHT", countToken: "COUNT", count: string | number]): ChainableCommander
  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

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

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN", callback: Callback<unknown>]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN", callback: Callback<unknown>]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN"]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN"]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number, callback: Callback<unknown>]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number, callback: Callback<unknown>]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], min: "MIN", countToken: "COUNT", count: string | number]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX", callback: Callback<unknown>]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX", callback: Callback<unknown>]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX"]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX"]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number, callback: Callback<unknown>]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number, callback: Callback<unknown>]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, ...keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number]): ChainableCommander
  • bzmpop(...args: [timeout: string | number, numkeys: string | number, keys: RedisKey[], max: "MAX", countToken: "COUNT", count: string | number]): ChainableCommander
  • call(command: string, callback?: Callback<unknown>): ChainableCommander
  • call(command: string, args: (string | number | Buffer)[], callback?: Callback<unknown>): ChainableCommander
  • call(...args: [command: string, ...args: (string | number | Buffer)[], callback: Callback<unknown>]): ChainableCommander
  • call(...args: [command: string, ...args: (string | number | Buffer)[]]): ChainableCommander
  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • callBuffer(command: string, callback?: Callback<unknown>): ChainableCommander
  • callBuffer(command: string, args: (string | number | Buffer)[], callback?: Callback<unknown>): ChainableCommander
  • callBuffer(...args: [command: string, ...args: (string | number | Buffer)[], callback: Callback<unknown>]): ChainableCommander
  • callBuffer(...args: [command: string, ...args: (string | number | Buffer)[]]): ChainableCommander
  • client(subcommand: "CACHING", yes: "YES", callback?: Callback<"OK">): ChainableCommander
  • client(subcommand: "CACHING", no: "NO", callback?: Callback<"OK">): ChainableCommander
  • client(subcommand: "GETNAME", callback?: Callback<string>): ChainableCommander
  • client(subcommand: "GETREDIR", callback?: Callback<number>): ChainableCommander
  • client(subcommand: "HELP", callback?: Callback<unknown>): ChainableCommander
  • client(subcommand: "ID", callback?: Callback<number>): ChainableCommander
  • client(subcommand: "INFO", callback?: Callback<string>): ChainableCommander
  • client(...args: [subcommand: "KILL", ...args: RedisValue[], callback: Callback<unknown>]): ChainableCommander
  • client(...args: [subcommand: "KILL", ...args: RedisValue[]]): ChainableCommander
  • client(subcommand: "LIST", callback?: Callback<unknown>): ChainableCommander
  • client(...args: [subcommand: "LIST", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]): ChainableCommander
  • client(...args: [subcommand: "LIST", idToken: "ID", ...clientIds: (string | number)[]]): ChainableCommander
  • client(subcommand: "LIST", type: "TYPE", normal: "NORMAL", callback?: Callback<unknown>): ChainableCommander
  • client(...args: [subcommand: "LIST", type: "TYPE", normal: "NORMAL", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]): ChainableCommander
  • client(...args: [subcommand: "LIST", type: "TYPE", normal: "NORMAL", idToken: "ID", ...clientIds: (string | number)[]]): ChainableCommander
  • client(subcommand: "LIST", type: "TYPE", master: "MASTER", callback?: Callback<unknown>): ChainableCommander
  • client(...args: [subcommand: "LIST", type: "TYPE", master: "MASTER", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]): ChainableCommander
  • client(...args: [subcommand: "LIST", type: "TYPE", master: "MASTER", idToken: "ID", ...clientIds: (string | number)[]]): ChainableCommander
  • client(subcommand: "LIST", type: "TYPE", replica: "REPLICA", callback?: Callback<unknown>): ChainableCommander
  • client(...args: [subcommand: "LIST", type: "TYPE", replica: "REPLICA", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]): ChainableCommander
  • client(...args: [subcommand: "LIST", type: "TYPE", replica: "REPLICA", idToken: "ID", ...clientIds: (string | number)[]]): ChainableCommander
  • client(subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", callback?: Callback<unknown>): ChainableCommander
  • client(...args: [subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", idToken: "ID", ...clientIds: (string | number)[], callback: Callback<unknown>]): ChainableCommander
  • client(...args: [subcommand: "LIST", type: "TYPE", pubsub: "PUBSUB", idToken: "ID", ...clientIds: (string | number)[]]): ChainableCommander
  • client(subcommand: "NO-EVICT", on: "ON", callback?: Callback<unknown>): ChainableCommander
  • client(subcommand: "NO-EVICT", off: "OFF", callback?: Callback<unknown>): ChainableCommander
  • client(subcommand: "PAUSE", timeout: string | number, callback?: Callback<"OK">): ChainableCommander
  • client(subcommand: "PAUSE", timeout: string | number, write: "WRITE", callback?: Callback<"OK">): ChainableCommander
  • client(subcommand: "PAUSE", timeout: string | number, all: "ALL", callback?: Callback<"OK">): ChainableCommander
  • client(subcommand: "REPLY", on: "ON", callback?: Callback<unknown>): ChainableCommander
  • client(subcommand: "REPLY", off: "OFF", callback?: Callback<unknown>): ChainableCommander
  • client(subcommand: "REPLY", skip: "SKIP", callback?: Callback<unknown>): ChainableCommander
  • client(subcommand: "SETNAME", connectionName: string | Buffer, callback?: Callback<"OK">): ChainableCommander
  • client(...args: [subcommand: "TRACKING", ...args: RedisValue[], callback: Callback<unknown>]): ChainableCommander
  • client(...args: [subcommand: "TRACKING", ...args: RedisValue[]]): ChainableCommander
  • client(subcommand: "TRACKINGINFO", callback?: Callback<string>): ChainableCommander
  • client(subcommand: "UNBLOCK", clientId: string | number, callback?: Callback<unknown>): ChainableCommander
  • client(subcommand: "UNBLOCK", clientId: string | number, timeout: "TIMEOUT", callback?: Callback<unknown>): ChainableCommander
  • client(subcommand: "UNBLOCK", clientId: string | number, error: "ERROR", callback?: Callback<unknown>): ChainableCommander
  • client(subcommand: "UNPAUSE", callback?: Callback<"OK">): ChainableCommander
  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Get the current connection name

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

    Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Show helpful text about the different subcommands

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

    Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Returns information about the current client connection.

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

    Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

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

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Advance the cluster config epoch

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

    Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Show helpful text about the different subcommands

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

    Parameters

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

    Returns ChainableCommander

  • Provides info about Redis Cluster node state

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

    Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Return the node id

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

    Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

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

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

    Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Show helpful text about the different subcommands

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

    Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • config(...args: [subcommand: "GET", ...parameters: (string | Buffer)[], callback: Callback<unknown>]): ChainableCommander
  • config(...args: [subcommand: "GET", ...parameters: (string | Buffer)[]]): ChainableCommander
  • config(subcommand: "HELP", callback?: Callback<unknown>): ChainableCommander
  • config(subcommand: "RESETSTAT", callback?: Callback<unknown>): ChainableCommander
  • config(subcommand: "REWRITE", callback?: Callback<unknown>): ChainableCommander
  • config(...args: [subcommand: "SET", ...parameterValues: (string | number | Buffer)[], callback: Callback<unknown>]): ChainableCommander
  • config(...args: [subcommand: "SET", ...parameterValues: (string | number | Buffer)[]]): ChainableCommander
  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Show helpful text about the different subcommands

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

    Parameters

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

    Returns ChainableCommander

  • Reset the stats returned by INFO

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

    Parameters

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

    Returns ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Return the number of keys in the selected database

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

    Parameters

    • Optional callback: Callback<number>

    Returns ChainableCommander

  • debug(subcommand: string, callback?: Callback<unknown>): ChainableCommander
  • debug(...args: [subcommand: string, ...args: (string | number | Buffer)[], callback: Callback<unknown>]): ChainableCommander
  • debug(...args: [subcommand: string, ...args: (string | number | Buffer)[]]): ChainableCommander
  • 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 ChainableCommander

  • 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 ChainableCommander

  • 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 ChainableCommander

  • Echo the given string

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

    Parameters

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

    Returns ChainableCommander

  • eval(script: string | Buffer, numkeys: string | number, callback?: Callback<unknown>): ChainableCommander
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[], callback: Callback<unknown>]): ChainableCommander
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[]]): ChainableCommander
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...keys: RedisKey[], callback: Callback<unknown>]): ChainableCommander
  • eval(...args: [script: string | Buffer, numkeys: string | number, keys: RedisKey[], callback: Callback<unknown>]): ChainableCommander
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...keys: RedisKey[]]): ChainableCommander
  • eval(...args: [script: string | Buffer, numkeys: string | number, keys: RedisKey[]]): ChainableCommander
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...args: RedisValue[], callback: Callback<unknown>]): ChainableCommander
  • eval(...args: [script: string | Buffer, numkeys: string | number, ...args: RedisValue[]]): ChainableCommander
  • evalsha(sha1: string | Buffer, numkeys: string | number, callback?: Callback<unknown>): ChainableCommander
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[], callback: Callback<unknown>]): ChainableCommander
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...args: (string | number | Buffer)[]]): ChainableCommander
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...keys: RedisKey[], callback: Callback<unknown>]): ChainableCommander
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, keys: RedisKey[], callback: Callback<unknown>]): ChainableCommander
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...keys: RedisKey[]]): ChainableCommander
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, keys: RedisKey[]]): ChainableCommander
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...args: RedisValue[], callback: Callback<unknown>]): ChainableCommander
  • evalsha(...args: [sha1: string | Buffer, numkeys: string | number, ...args: RedisValue[]]): ChainableCommander
  • exec(callback?: Callback<[error: Error, result: unknown][]>): Promise<[error: Error, result: unknown][]>
  • Execute all commands issued after MULTI

    • group: transactions
    • complexity: Depends on commands in the transaction
    • since: 1.2.0

    Parameters

    • Optional callback: Callback<[error: Error, result: unknown][]>

    Returns Promise<[error: Error, result: unknown][]>

  • failover(callback?: Callback<"OK">): ChainableCommander
  • failover(millisecondsToken: "TIMEOUT", milliseconds: string | number, callback?: Callback<"OK">): ChainableCommander
  • failover(abort: "ABORT", callback?: Callback<"OK">): ChainableCommander
  • failover(abort: "ABORT", millisecondsToken: "TIMEOUT", milliseconds: string | number, callback?: Callback<"OK">): ChainableCommander
  • failover(targetToken: "TO", host: string | Buffer, port: string | number, callback?: Callback<"OK">): ChainableCommander
  • failover(targetToken: "TO", host: string | Buffer, port: string | number, millisecondsToken: "TIMEOUT", milliseconds: string | number, callback?: Callback<"OK">): ChainableCommander
  • failover(targetToken: "TO", host: string | Buffer, port: string | number, abort: "ABORT", callback?: Callback<"OK">): ChainableCommander
  • failover(targetToken: "TO", host: string | Buffer, port: string | number, abort: "ABORT", millisecondsToken: "TIMEOUT", milliseconds: string | number, callback?: Callback<"OK">): ChainableCommander
  • failover(targetToken: "TO", host: string | Buffer, port: string | number, force: "FORCE", callback?: Callback<"OK">): ChainableCommander
  • failover(targetToken: "TO", host: string | Buffer, port: string | number, force: "FORCE", millisecondsToken: "TIMEOUT", milliseconds: string | number, callback?: Callback<"OK">): ChainableCommander
  • failover(targetToken: "TO", host: string | Buffer, port: string | number, force: "FORCE", abort: "ABORT", callback?: Callback<"OK">): ChainableCommander
  • failover(targetToken: "TO", host: string | Buffer, port: string | number, force: "FORCE", abort: "ABORT", millisecondsToken: "TIMEOUT", milliseconds: string | number, callback?: Callback<"OK">): ChainableCommander
  • Start a coordinated failover between this server and one of its replicas.

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

    Parameters

    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • millisecondsToken: "TIMEOUT"
    • milliseconds: string | number
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • abort: "ABORT"
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • abort: "ABORT"
    • millisecondsToken: "TIMEOUT"
    • milliseconds: string | number
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • targetToken: "TO"
    • host: string | Buffer
    • port: string | number
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • targetToken: "TO"
    • host: string | Buffer
    • port: string | number
    • millisecondsToken: "TIMEOUT"
    • milliseconds: string | number
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • targetToken: "TO"
    • host: string | Buffer
    • port: string | number
    • abort: "ABORT"
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • targetToken: "TO"
    • host: string | Buffer
    • port: string | number
    • abort: "ABORT"
    • millisecondsToken: "TIMEOUT"
    • milliseconds: string | number
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • targetToken: "TO"
    • host: string | Buffer
    • port: string | number
    • force: "FORCE"
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • targetToken: "TO"
    • host: string | Buffer
    • port: string | number
    • force: "FORCE"
    • millisecondsToken: "TIMEOUT"
    • milliseconds: string | number
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • targetToken: "TO"
    • host: string | Buffer
    • port: string | number
    • force: "FORCE"
    • abort: "ABORT"
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • Parameters

    • targetToken: "TO"
    • host: string | Buffer
    • port: string | number
    • force: "FORCE"
    • abort: "ABORT"
    • millisecondsToken: "TIMEOUT"
    • milliseconds: string | number
    • Optional callback: Callback<"OK">

    Returns ChainableCommander

  • function(subcommand: "DELETE", libraryName: string | Buffer, callback?: Callback<string>): ChainableCommander
  • function(subcommand: "DUMP", callback?: Callback<string>): ChainableCommander
  • function(subcommand: "FLUSH", callback?: Callback<string>): ChainableCommander
  • function(subcommand: "FLUSH", async: "ASYNC", callback?: Callback<string>): ChainableCommander
  • function(subcommand: "FLUSH", sync: "SYNC", callback?: Callback<string>): ChainableCommander
  • function(subcommand: "HELP", callback?: Callback<unknown>): ChainableCommander
  • function(subcommand: "KILL", callback?: Callback<string>): ChainableCommander
  • function(subcommand: "LIST", callback?: Callback<unknown[]>): ChainableCommander
  • function(subcommand: "LIST", withcode: "WITHCODE", callback?: Callback<unknown[]>): ChainableCommander
  • function(subcommand: "LIST", libraryNamePatternToken: "LIBRARYNAME", libraryNamePattern: string | Buffer, callback?: Callback<unknown[]>): ChainableCommander
  • function(subcommand: "LIST", libraryNamePatternToken: "LIBRARYNAME", libraryNamePattern: string | Buffer, withcode: "WITHCODE", callback?: Callback<unknown[]>): ChainableCommander
  • function(subcommand: "LOAD", functionCode: string | Buffer, callback?: Callback<string>): ChainableCommander
  • function(subcommand: "LOAD", replace: "REPLACE", functionCode: string | Buffer, callback?: Callback<string>): ChainableCommander
  • function(subcommand: "RESTORE", serializedValue: string | number | Buffer, callback?: Callback<string>): ChainableCommander
  • function(subcommand: "RESTORE", serializedValue: string | number | Buffer, flush: "FLUSH", callback?: Callback<string>): ChainableCommander
  • function(subcommand: "RESTORE", serializedValue: string | number | Buffer, append: "APPEND", callback?: Callback<string>): ChainableCommander
  • function(subcommand: "RESTORE", serializedValue: string | number | Buffer, replace: "REPLACE", callback?: Callback<string>): ChainableCommander
  • function(subcommand: "STATS", callback?: Callback<unknown>): ChainableCommander
  • Delete a function by name

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

    Parameters

    • subcommand: "DELETE"
    • libraryName: string | Buffer
    • Optional callback: Callback<string>

    Returns ChainableCommander

  • Dump all functions into a serialized binary payload

    • group: scripting
    • complexity: O(N) where N is the number of functions
    • since: 7.0.0

    Parameters

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

    Returns ChainableCommander

  • Deleting all functions

    • group: scripting
    • complexity: O(N) where N is the number of functions deleted
    • since: 7.0.0

    Parameters

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

    Returns ChainableCommander

  • Parameters

    • subcommand: "FLUSH"
    • async: "ASYNC"
    • Optional callback: Callback<string>

    Returns ChainableCommander

  • Parameters

    • subcommand: "FLUSH"
    • sync: "SYNC"
    • Optional callback: Callback<string>

    Returns ChainableCommander

  • Show helpful text about the different subcommands

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

    Parameters

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

    Returns ChainableCommander

  • Kill the function currently in execution.

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

    Parameters

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

    Returns ChainableCommander

  • List information about all the functions

    • group: scripting
    • complexity: O(N) where N is the number of functions
    • since: 7.0.0

    Parameters

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

    Returns ChainableCommander

  • Parameters

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

    Returns ChainableCommander

  • Parameters

    • subcommand: "LIST"
    • libraryNamePatternToken: "LIBRARYNAME"
    • libraryNamePattern: string | Buffer
    • Optional callback: Callback<unknown[]>

    Returns ChainableCommander

  • Parameters

    • subcommand: "LIST"
    • libraryNamePatternToken: "LIBRARYNAME"
    • libraryNamePattern: string | Buffer
    • withcode: "WITHCODE"
    • Optional callback: Callback<unknown[]>

    Returns ChainableCommander

  • Create a function with the given arguments (name, code, description)

    • group: scripting
    • complexity: O(1) (considering compilation time is redundant)
    • since: 7.0.0

    Parameters

    • subcommand: "LOAD"
    • functionCode: string | Buffer
    • Optional callback: Callback<string>

    Returns ChainableCommander

  • Parameters

    • subcommand: "LOAD"
    • replace: "REPLACE"
    • functionCode: string | Buffer
    • Optional callback: Callback<string>

    Returns ChainableCommander

  • Restore all the functions on the given payload

    • group: scripting
    • complexity: O(N) where N is the number of functions on the payload
    • since: 7.0.0

    Parameters

    • subcommand: "RESTORE"
    • serializedValue: string | number | Buffer
    • Optional callback: Callback<string>

    Returns ChainableCommander

  • Parameters

    • subcommand: "RESTORE"
    • serializedValue: string | number | Buffer
    • flush: "FLUSH"
    • Optional callback: Callback<string>

    Returns ChainableCommander

  • Parameters

    • subcommand: "RESTORE"
    • serializedValue: string | number | Buffer
    • append: "APPEND"
    • Optional callback: Callback<string>

    Returns ChainableCommander

  • Parameters

    • subcommand: "RESTORE"
    • serializedValue: string | number | Buffer
    • replace: "REPLACE"
    • Optional callback: Callback<string>

    Returns ChainableCommander

  • Return information about the function currently running (name, description, duration)

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

    Parameters

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

    Returns ChainableCommander

  • functionBuffer(subcommand: "DELETE", libraryName: string | Buffer, callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "DUMP", callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "FLUSH", callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "FLUSH", async: "ASYNC", callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "FLUSH", sync: "SYNC", callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "KILL", callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "LOAD", functionCode: string | Buffer, callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "LOAD", replace: "REPLACE", functionCode: string | Buffer, callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "RESTORE", serializedValue: string | number | Buffer, callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "RESTORE", serializedValue: string | number | Buffer, flush: "FLUSH", callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "RESTORE", serializedValue: string | number | Buffer, append: "APPEND", callback?: Callback<Buffer>): ChainableCommander
  • functionBuffer(subcommand: "RESTORE", serializedValue: string | number | Buffer, replace: "REPLACE", callback?: Callback<Buffer>): ChainableCommander