diff --git a/lib/utils/RedisCommander.ts b/lib/utils/RedisCommander.ts index ad671fc2..acd591b3 100644 --- a/lib/utils/RedisCommander.ts +++ b/lib/utils/RedisCommander.ts @@ -56,6 +56,7 @@ interface RedisCommander { * 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 */ acl(subcommand: 'CAT', callback?: Callback): Result; acl(subcommand: 'CAT', categoryname: string | Buffer, callback?: Callback): Result; @@ -64,6 +65,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: server * - _complexity_: O(1) + * - _since_: 6.0.0 */ acl(subcommand: 'HELP', callback?: Callback): Result; @@ -71,6 +73,7 @@ interface RedisCommander { * 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 */ acl(subcommand: 'SAVE', callback?: Callback<"OK">): Result<"OK", Context>; @@ -78,6 +81,7 @@ interface RedisCommander { * 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 */ acl(subcommand: 'LIST', callback?: Callback): Result; aclBuffer(subcommand: 'LIST', callback?: Callback): Result; @@ -86,6 +90,7 @@ interface RedisCommander { * 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 */ acl(subcommand: 'LOAD', callback?: Callback<"OK">): Result<"OK", Context>; @@ -93,6 +98,7 @@ interface RedisCommander { * 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 */ acl(subcommand: 'SETUSER', username: string | Buffer, callback?: Callback<"OK">): Result<"OK", Context>; acl(...args: [subcommand: 'SETUSER', username: string | Buffer, ...rules: (string | Buffer)[], callback: Callback<"OK">]): Result<"OK", Context>; @@ -102,6 +108,7 @@ interface RedisCommander { * Generate a pseudorandom secure password to use for ACL users * - _group_: server * - _complexity_: O(1) + * - _since_: 6.0.0 */ acl(subcommand: 'GENPASS', callback?: Callback): Result; aclBuffer(subcommand: 'GENPASS', callback?: Callback): Result; @@ -112,6 +119,7 @@ interface RedisCommander { * Returns whether the user can execute the given command without executing the command. * - _group_: server * - _complexity_: O(1). + * - _since_: 7.0.0 */ acl(subcommand: 'DRYRUN', username: string | Buffer, command: string | Buffer, callback?: Callback): Result; aclBuffer(subcommand: 'DRYRUN', username: string | Buffer, command: string | Buffer, callback?: Callback): Result; @@ -124,6 +132,7 @@ interface RedisCommander { * 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 */ acl(subcommand: 'GETUSER', username: string | Buffer, callback?: Callback): Result; aclBuffer(subcommand: 'GETUSER', username: string | Buffer, callback?: Callback): Result; @@ -132,6 +141,7 @@ interface RedisCommander { * Return the name of the user associated to the current connection * - _group_: server * - _complexity_: O(1) + * - _since_: 6.0.0 */ acl(subcommand: 'WHOAMI', callback?: Callback): Result; aclBuffer(subcommand: 'WHOAMI', callback?: Callback): Result; @@ -140,6 +150,7 @@ interface RedisCommander { * 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 */ acl(subcommand: 'USERS', callback?: Callback): Result; aclBuffer(subcommand: 'USERS', callback?: Callback): Result; @@ -148,6 +159,7 @@ interface RedisCommander { * Remove the specified ACL users and the associated rules * - _group_: server * - _complexity_: O(1) amortized time considering the typical user. + * - _since_: 6.0.0 */ acl(...args: [subcommand: 'DELUSER', ...usernames: (string | Buffer)[], callback: Callback]): Result; acl(...args: [subcommand: 'DELUSER', ...usernames: (string | Buffer)[]]): Result; @@ -156,6 +168,7 @@ interface RedisCommander { * 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 */ acl(subcommand: 'LOG', callback?: Callback): Result; acl(subcommand: 'LOG', count: number, callback?: Callback): Result; @@ -165,6 +178,7 @@ interface RedisCommander { * 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 */ append(key: RedisKey, value: string | Buffer | number, callback?: Callback): Result; @@ -172,6 +186,7 @@ interface RedisCommander { * Sent by cluster clients after an -ASK redirect * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ asking(callback?: Callback<'OK'>): Result<'OK', Context>; @@ -179,6 +194,7 @@ interface RedisCommander { * Authenticate to the server * - _group_: connection * - _complexity_: O(N) where N is the number of passwords defined for the user + * - _since_: 1.0.0 */ auth(password: string | Buffer, callback?: Callback<'OK'>): Result<'OK', Context>; auth(username: string | Buffer, password: string | Buffer, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -187,6 +203,7 @@ interface RedisCommander { * Asynchronously rewrite the append-only file * - _group_: server * - _complexity_: O(1) + * - _since_: 1.0.0 */ bgrewriteaof(callback?: Callback): Result; bgrewriteaofBuffer(callback?: Callback): Result; @@ -195,6 +212,7 @@ interface RedisCommander { * Asynchronously save the dataset to disk * - _group_: server * - _complexity_: O(1) + * - _since_: 1.0.0 */ bgsave(callback?: Callback<'OK'>): Result<'OK', Context>; bgsave(schedule: 'SCHEDULE', callback?: Callback<'OK'>): Result<'OK', Context>; @@ -203,6 +221,7 @@ interface RedisCommander { * Count set bits in a string * - _group_: bitmap * - _complexity_: O(N) + * - _since_: 2.6.0 */ bitcount(key: RedisKey, callback?: Callback): Result; bitcount(key: RedisKey, start: number, end: number, callback?: Callback): Result; @@ -213,6 +232,7 @@ interface RedisCommander { * Perform arbitrary bitfield integer operations on strings * - _group_: bitmap * - _complexity_: O(1) for each subcommand specified + * - _since_: 3.2.0 */ bitfield(key: RedisKey, callback?: Callback): Result; bitfield(key: RedisKey, overflow: 'OVERFLOW', wrap: 'WRAP', callback?: Callback): Result; @@ -251,6 +271,7 @@ interface RedisCommander { * Perform arbitrary bitfield integer operations on strings. Read-only variant of BITFIELD * - _group_: bitmap * - _complexity_: O(1) for each subcommand specified + * - _since_: 6.2.0 */ bitfield_ro(key: RedisKey, encodingOffsetToken: 'GET', encoding: string | Buffer, offset: number | string, callback?: Callback): Result; @@ -258,6 +279,7 @@ interface RedisCommander { * Perform bitwise operations between strings * - _group_: bitmap * - _complexity_: O(N) + * - _since_: 2.6.0 */ bitop(...args: [operation: string | Buffer, destkey: RedisKey, ...keys: (RedisKey)[], callback: Callback]): Result; bitop(...args: [operation: string | Buffer, destkey: RedisKey, keys: (RedisKey)[], callback: Callback]): Result; @@ -268,6 +290,7 @@ interface RedisCommander { * Find first bit set or clear in a string * - _group_: bitmap * - _complexity_: O(N) + * - _since_: 2.8.7 */ bitpos(key: RedisKey, bit: number | string, callback?: Callback): Result; bitpos(key: RedisKey, bit: number | string, start: number, callback?: Callback): Result; @@ -279,6 +302,7 @@ interface RedisCommander { * 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 */ blmove(source: RedisKey, destination: RedisKey, left: 'LEFT', left1: 'LEFT', timeout: number | string, callback?: Callback): Result; blmoveBuffer(source: RedisKey, destination: RedisKey, left: 'LEFT', left1: 'LEFT', timeout: number | string, callback?: Callback): Result; @@ -293,6 +317,7 @@ interface RedisCommander { * 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 */ blpop(...args: [...keys: (RedisKey)[], timeout: number | string, callback: Callback<[string, string] | null>]): Result<[string, string] | null, Context>; blpopBuffer(...args: [...keys: (RedisKey)[], timeout: number | string, callback: Callback<[Buffer, Buffer] | null>]): Result<[Buffer, Buffer] | null, Context>; @@ -307,6 +332,7 @@ interface RedisCommander { * 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 */ brpop(...args: [...keys: (RedisKey)[], timeout: number | string, callback: Callback<[string, string] | null>]): Result<[string, string] | null, Context>; brpopBuffer(...args: [...keys: (RedisKey)[], timeout: number | string, callback: Callback<[Buffer, Buffer] | null>]): Result<[Buffer, Buffer] | null, Context>; @@ -321,6 +347,7 @@ interface RedisCommander { * 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 */ brpoplpush(source: RedisKey, destination: RedisKey, timeout: number | string, callback?: Callback): Result; brpoplpushBuffer(source: RedisKey, destination: RedisKey, timeout: number | string, callback?: Callback): Result; @@ -329,6 +356,7 @@ interface RedisCommander { * 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 */ bzpopmax(...args: [...keys: (RedisKey)[], timeout: number | string, callback: Callback]): Result; bzpopmax(...args: [keys: (RedisKey)[], timeout: number | string, callback: Callback]): Result; @@ -339,6 +367,7 @@ interface RedisCommander { * 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 */ bzpopmin(...args: [...keys: (RedisKey)[], timeout: number | string, callback: Callback]): Result; bzpopmin(...args: [keys: (RedisKey)[], timeout: number | string, callback: Callback]): Result; @@ -349,6 +378,7 @@ interface RedisCommander { * Resume processing of clients that were paused * - _group_: connection * - _complexity_: O(N) Where N is the number of paused clients + * - _since_: 6.2.0 */ client(subcommand: 'UNPAUSE', callback?: Callback<"OK">): Result<"OK", Context>; @@ -356,6 +386,7 @@ interface RedisCommander { * Get the list of client connections * - _group_: connection * - _complexity_: O(N) where N is the number of client connections + * - _since_: 2.4.0 */ client(subcommand: 'LIST', callback?: Callback): Result; client(...args: [subcommand: 'LIST', idToken: 'ID', ...clientIds: (number | string)[], callback: Callback]): Result; @@ -377,6 +408,7 @@ interface RedisCommander { * Set client eviction mode for the current connection * - _group_: connection * - _complexity_: O(1) + * - _since_: 7.0.0 */ client(subcommand: 'NO-EVICT', on: 'ON', callback?: Callback): Result; client(subcommand: 'NO-EVICT', off: 'OFF', callback?: Callback): Result; @@ -385,6 +417,7 @@ interface RedisCommander { * Returns the client ID for the current connection * - _group_: connection * - _complexity_: O(1) + * - _since_: 5.0.0 */ client(subcommand: 'ID', callback?: Callback): Result; @@ -392,6 +425,7 @@ interface RedisCommander { * 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 */ client(subcommand: 'UNBLOCK', clientId: number | string, callback?: Callback): Result; client(subcommand: 'UNBLOCK', clientId: number | string, timeout: 'TIMEOUT', callback?: Callback): Result; @@ -401,6 +435,7 @@ interface RedisCommander { * Enable or disable server assisted client side caching support * - _group_: connection * - _complexity_: O(1). Some options may introduce additional complexity. + * - _since_: 6.0.0 */ client(...args: [subcommand: 'TRACKING', ...args: (RedisValue)[], callback: Callback]): Result; client(...args: [subcommand: 'TRACKING', ...args: (RedisValue)[]]): Result; @@ -409,6 +444,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: connection * - _complexity_: O(1) + * - _since_: 5.0.0 */ client(subcommand: 'HELP', callback?: Callback): Result; @@ -416,6 +452,7 @@ interface RedisCommander { * Set the current connection name * - _group_: connection * - _complexity_: O(1) + * - _since_: 2.6.9 */ client(subcommand: 'SETNAME', connectionName: string | Buffer, callback?: Callback<"OK">): Result<"OK", Context>; @@ -423,6 +460,7 @@ interface RedisCommander { * Stop processing commands from clients for some time * - _group_: connection * - _complexity_: O(1) + * - _since_: 2.9.50 */ client(subcommand: 'PAUSE', timeout: number | string, callback?: Callback<"OK">): Result<"OK", Context>; client(subcommand: 'PAUSE', timeout: number | string, write: 'WRITE', callback?: Callback<"OK">): Result<"OK", Context>; @@ -432,6 +470,7 @@ interface RedisCommander { * Return information about server assisted client side caching for the current connection * - _group_: connection * - _complexity_: O(1) + * - _since_: 6.2.0 */ client(subcommand: 'TRACKINGINFO', callback?: Callback): Result; clientBuffer(subcommand: 'TRACKINGINFO', callback?: Callback): Result; @@ -440,6 +479,7 @@ interface RedisCommander { * Returns information about the current client connection. * - _group_: connection * - _complexity_: O(1) + * - _since_: 6.2.0 */ client(subcommand: 'INFO', callback?: Callback): Result; clientBuffer(subcommand: 'INFO', callback?: Callback): Result; @@ -448,6 +488,7 @@ interface RedisCommander { * Get tracking notifications redirection client ID if any * - _group_: connection * - _complexity_: O(1) + * - _since_: 6.0.0 */ client(subcommand: 'GETREDIR', callback?: Callback): Result; @@ -455,6 +496,7 @@ interface RedisCommander { * Get the current connection name * - _group_: connection * - _complexity_: O(1) + * - _since_: 2.6.9 */ client(subcommand: 'GETNAME', callback?: Callback): Result; clientBuffer(subcommand: 'GETNAME', callback?: Callback): Result; @@ -463,6 +505,7 @@ interface RedisCommander { * Instruct the server about tracking or not keys in the next request * - _group_: connection * - _complexity_: O(1) + * - _since_: 6.0.0 */ client(subcommand: 'CACHING', yes: 'YES', callback?: Callback<"OK">): Result<"OK", Context>; client(subcommand: 'CACHING', no: 'NO', callback?: Callback<"OK">): Result<"OK", Context>; @@ -471,6 +514,7 @@ interface RedisCommander { * Instruct the server whether to reply to commands * - _group_: connection * - _complexity_: O(1) + * - _since_: 3.2.0 */ client(subcommand: 'REPLY', on: 'ON', callback?: Callback): Result; client(subcommand: 'REPLY', off: 'OFF', callback?: Callback): Result; @@ -480,6 +524,7 @@ interface RedisCommander { * Kill the connection of a client * - _group_: connection * - _complexity_: O(N) where N is the number of client connections + * - _since_: 2.4.0 */ client(...args: [subcommand: 'KILL', ...args: (RedisValue)[], callback: Callback]): Result; client(...args: [subcommand: 'KILL', ...args: (RedisValue)[]]): Result; @@ -488,6 +533,7 @@ interface RedisCommander { * Forces a replica to perform a manual failover of its master. * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'FAILOVER', callback?: Callback<'OK'>): Result<'OK', Context>; cluster(subcommand: 'FAILOVER', force: 'FORCE', callback?: Callback<'OK'>): Result<'OK', Context>; @@ -497,6 +543,7 @@ interface RedisCommander { * 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 */ cluster(subcommand: 'LINKS', callback?: Callback): Result; @@ -504,6 +551,7 @@ interface RedisCommander { * 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 */ cluster(...args: [subcommand: 'ADDSLOTS', ...slots: (number | string)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Result<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][], Context>; cluster(...args: [subcommand: 'ADDSLOTS', slots: (number | string)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Result<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][], Context>; @@ -514,6 +562,7 @@ interface RedisCommander { * Get Cluster config for the node * - _group_: cluster * - _complexity_: O(N) where N is the total number of Cluster nodes + * - _since_: 3.0.0 */ cluster(subcommand: 'NODES', callback?: Callback): Result; @@ -521,6 +570,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: cluster * - _complexity_: O(1) + * - _since_: 5.0.0 */ cluster(subcommand: 'HELP', callback?: Callback): Result; @@ -528,6 +578,7 @@ interface RedisCommander { * Return the number of local keys in the specified hash slot * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'COUNTKEYSINSLOT', slot: number | string, callback?: Callback): Result; @@ -535,6 +586,7 @@ interface RedisCommander { * Bind a hash slot to a specific node * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'SETSLOT', slot: number | string, nodeIdToken: 'IMPORTING', nodeId: number | string, callback?: Callback<'OK'>): Result<'OK', Context>; cluster(subcommand: 'SETSLOT', slot: number | string, nodeIdToken: 'MIGRATING', nodeId: number | string, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -545,6 +597,7 @@ interface RedisCommander { * Delete a node's own slots information * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'FLUSHSLOTS', callback?: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>): Result<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][], Context>; @@ -552,6 +605,7 @@ interface RedisCommander { * 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 */ cluster(subcommand: 'COUNT-FAILURE-REPORTS', nodeId: string | Buffer | number, callback?: Callback): Result; @@ -559,6 +613,7 @@ interface RedisCommander { * Forces the node to save cluster state on disk * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'SAVECONFIG', callback?: Callback<'OK'>): Result<'OK', Context>; @@ -566,6 +621,7 @@ interface RedisCommander { * 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 */ cluster(subcommand: 'SLOTS', callback?: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>): Result<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][], Context>; @@ -573,6 +629,7 @@ interface RedisCommander { * Advance the cluster config epoch * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'BUMPEPOCH', callback?: Callback<'BUMPED' | 'STILL'>): Result<'BUMPED' | 'STILL', Context>; @@ -580,6 +637,7 @@ interface RedisCommander { * 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 */ cluster(...args: [subcommand: 'DELSLOTS', ...slots: (number | string)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Result<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][], Context>; cluster(...args: [subcommand: 'DELSLOTS', slots: (number | string)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Result<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][], Context>; @@ -590,6 +648,7 @@ interface RedisCommander { * 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 */ cluster(subcommand: 'RESET', callback?: Callback<'OK'>): Result<'OK', Context>; cluster(subcommand: 'RESET', hard: 'HARD', callback?: Callback<'OK'>): Result<'OK', Context>; @@ -599,6 +658,7 @@ interface RedisCommander { * Reconfigure a node as a replica of the specified master node * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'REPLICATE', nodeId: string | Buffer | number, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -606,6 +666,7 @@ interface RedisCommander { * Set the configuration epoch in a new node * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'SET-CONFIG-EPOCH', configEpoch: number | string, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -613,6 +674,7 @@ interface RedisCommander { * Force a node cluster to handshake with another node * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'MEET', ip: string | Buffer, port: number | string, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -620,6 +682,7 @@ interface RedisCommander { * 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 */ cluster(...args: [subcommand: 'ADDSLOTSRANGE', ...startSlotEndSlots: (number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Result<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][], Context>; cluster(...args: [subcommand: 'ADDSLOTSRANGE', ...startSlotEndSlots: (number)[]]): Result<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][], Context>; @@ -628,6 +691,7 @@ interface RedisCommander { * Return the node id * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'MYID', callback?: Callback): Result; @@ -635,6 +699,7 @@ interface RedisCommander { * List replica nodes of the specified master node * - _group_: cluster * - _complexity_: O(1) + * - _since_: 5.0.0 */ cluster(subcommand: 'REPLICAS', nodeId: string | Buffer | number, callback?: Callback): Result; @@ -642,6 +707,7 @@ interface RedisCommander { * Remove a node from the nodes table * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'FORGET', nodeId: string | Buffer | number, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -649,6 +715,7 @@ interface RedisCommander { * 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 */ cluster(...args: [subcommand: 'DELSLOTSRANGE', ...startSlotEndSlots: (number)[], callback: Callback<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][]>]): Result<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][], Context>; cluster(...args: [subcommand: 'DELSLOTSRANGE', ...startSlotEndSlots: (number)[]]): Result<[startSlotRange: number, endSlotRange: number, ...nodes: [host: string, port: number, nodeId: string, info: unknown[]][]][], Context>; @@ -657,6 +724,7 @@ interface RedisCommander { * Provides info about Redis Cluster node state * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'INFO', callback?: Callback): Result; @@ -664,6 +732,7 @@ interface RedisCommander { * 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 */ cluster(subcommand: 'KEYSLOT', key: string | Buffer, callback?: Callback): Result; @@ -671,6 +740,7 @@ interface RedisCommander { * List replica nodes of the specified master node * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ cluster(subcommand: 'SLAVES', nodeId: string | Buffer | number, callback?: Callback): Result; @@ -678,6 +748,7 @@ interface RedisCommander { * 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 */ cluster(subcommand: 'GETKEYSINSLOT', slot: number | string, count: number, callback?: Callback): Result; @@ -685,6 +756,7 @@ interface RedisCommander { * 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 */ command(subcommand: 'LIST', callback?: Callback): Result; command(subcommand: 'LIST', filterby: 'FILTERBY', moduleNameToken: 'MODULE', moduleName: string | Buffer, callback?: Callback): Result; @@ -695,6 +767,7 @@ interface RedisCommander { * 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 */ command(subcommand: 'DOCS', callback?: Callback): Result; command(...args: [subcommand: 'DOCS', ...commandNames: (string | Buffer)[], callback: Callback]): Result; @@ -704,6 +777,7 @@ interface RedisCommander { * 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 */ command(subcommand: 'INFO', callback?: Callback): Result; command(...args: [subcommand: 'INFO', ...commandNames: (string | Buffer)[], callback: Callback]): Result; @@ -713,6 +787,7 @@ interface RedisCommander { * Get total number of Redis commands * - _group_: server * - _complexity_: O(1) + * - _since_: 2.8.13 */ command(subcommand: 'COUNT', callback?: Callback): Result; @@ -720,6 +795,7 @@ interface RedisCommander { * 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 */ command(subcommand: 'GETKEYS', callback?: Callback): Result; @@ -727,6 +803,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: server * - _complexity_: O(1) + * - _since_: 5.0.0 */ command(subcommand: 'HELP', callback?: Callback): Result; @@ -734,6 +811,7 @@ interface RedisCommander { * Reset the stats returned by INFO * - _group_: server * - _complexity_: O(1) + * - _since_: 2.0.0 */ config(subcommand: 'RESETSTAT', callback?: Callback): Result; @@ -741,6 +819,7 @@ interface RedisCommander { * Rewrite the configuration file with the in memory configuration * - _group_: server * - _complexity_: O(1) + * - _since_: 2.8.0 */ config(subcommand: 'REWRITE', callback?: Callback): Result; @@ -748,6 +827,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: server * - _complexity_: O(1) + * - _since_: 5.0.0 */ config(subcommand: 'HELP', callback?: Callback): Result; @@ -755,6 +835,7 @@ interface RedisCommander { * Get the values of configuration parameters * - _group_: server * - _complexity_: O(N) when N is the number of configuration parameters provided + * - _since_: 2.0.0 */ config(...args: [subcommand: 'GET', ...parameters: (string | Buffer)[], callback: Callback]): Result; config(...args: [subcommand: 'GET', ...parameters: (string | Buffer)[]]): Result; @@ -763,6 +844,7 @@ interface RedisCommander { * 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 */ config(...args: [subcommand: 'SET', ...parameterValues: (string | Buffer | number)[], callback: Callback]): Result; config(...args: [subcommand: 'SET', ...parameterValues: (string | Buffer | number)[]]): Result; @@ -771,6 +853,7 @@ interface RedisCommander { * 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 */ copy(source: RedisKey, destination: RedisKey, callback?: Callback): Result; copy(source: RedisKey, destination: RedisKey, replace: 'REPLACE', callback?: Callback): Result; @@ -781,6 +864,7 @@ interface RedisCommander { * Return the number of keys in the selected database * - _group_: server * - _complexity_: O(1) + * - _since_: 1.0.0 */ dbsize(callback?: Callback): Result; @@ -788,6 +872,7 @@ interface RedisCommander { * A container for debugging commands * - _group_: server * - _complexity_: Depends on subcommand. + * - _since_: 1.0.0 */ debug(subcommand: string, callback?: Callback): Result; debug(...args: [subcommand: string, ...args: (string | Buffer | number)[], callback: Callback]): Result; @@ -797,6 +882,7 @@ interface RedisCommander { * Decrement the integer value of a key by one * - _group_: string * - _complexity_: O(1) + * - _since_: 1.0.0 */ decr(key: RedisKey, callback?: Callback): Result; @@ -804,6 +890,7 @@ interface RedisCommander { * Decrement the integer value of a key by the given number * - _group_: string * - _complexity_: O(1) + * - _since_: 1.0.0 */ decrby(key: RedisKey, decrement: number | string, callback?: Callback): Result; @@ -811,6 +898,7 @@ interface RedisCommander { * 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 */ del(...args: [...keys: (RedisKey)[], callback: Callback]): Result; del(...args: [keys: (RedisKey)[], callback: Callback]): Result; @@ -821,6 +909,7 @@ interface RedisCommander { * Discard all commands issued after MULTI * - _group_: transactions * - _complexity_: O(N), when N is the number of queued commands + * - _since_: 2.0.0 */ discard(callback?: Callback<'OK'>): Result<'OK', Context>; @@ -828,6 +917,7 @@ interface RedisCommander { * Return a serialized version of the value stored at the specified key. * - _group_: generic * - _complexity_: O(1) to access the key and additional O(N*M) 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(1*M) where M is small, so simply O(1). + * - _since_: 2.6.0 */ dump(key: RedisKey, callback?: Callback): Result; dumpBuffer(key: RedisKey, callback?: Callback): Result; @@ -836,6 +926,7 @@ interface RedisCommander { * Echo the given string * - _group_: connection * - _complexity_: O(1) + * - _since_: 1.0.0 */ echo(message: string | Buffer, callback?: Callback): Result; echoBuffer(message: string | Buffer, callback?: Callback): Result; @@ -844,6 +935,7 @@ interface RedisCommander { * Execute a Lua script server side * - _group_: scripting * - _complexity_: Depends on the script that is executed. + * - _since_: 2.6.0 */ eval(script: string | Buffer, numkeys: number | string, callback?: Callback): Result; eval(...args: [script: string | Buffer, numkeys: number | string, ...args: (string | Buffer | number)[], callback: Callback]): Result; @@ -859,6 +951,7 @@ interface RedisCommander { * Execute a Lua script server side * - _group_: scripting * - _complexity_: Depends on the script that is executed. + * - _since_: 2.6.0 */ evalsha(sha1: string | Buffer, numkeys: number | string, callback?: Callback): Result; evalsha(...args: [sha1: string | Buffer, numkeys: number | string, ...args: (string | Buffer | number)[], callback: Callback]): Result; @@ -874,6 +967,7 @@ interface RedisCommander { * Execute all commands issued after MULTI * - _group_: transactions * - _complexity_: Depends on commands in the transaction + * - _since_: 1.2.0 */ exec(callback?: Callback<[error: Error | null, result: unknown][] | null>): Promise<[error: Error | null, result: unknown][] | null>; @@ -881,6 +975,7 @@ interface RedisCommander { * Determine if a key exists * - _group_: generic * - _complexity_: O(N) where N is the number of keys to check. + * - _since_: 1.0.0 */ exists(...args: [...keys: (RedisKey)[], callback: Callback]): Result; exists(...args: [keys: (RedisKey)[], callback: Callback]): Result; @@ -891,6 +986,7 @@ interface RedisCommander { * Set a key's time to live in seconds * - _group_: generic * - _complexity_: O(1) + * - _since_: 1.0.0 */ expire(key: RedisKey, seconds: number, callback?: Callback): Result; expire(key: RedisKey, seconds: number, nx: 'NX', callback?: Callback): Result; @@ -902,6 +998,7 @@ interface RedisCommander { * Set the expiration for a key as a UNIX timestamp * - _group_: generic * - _complexity_: O(1) + * - _since_: 1.2.0 */ expireat(key: RedisKey, unixTimeSeconds: number, callback?: Callback): Result; expireat(key: RedisKey, unixTimeSeconds: number, nx: 'NX', callback?: Callback): Result; @@ -913,6 +1010,7 @@ interface RedisCommander { * Start a coordinated failover between this server and one of its replicas. * - _group_: server * - _complexity_: O(1) + * - _since_: 6.2.0 */ failover(callback?: Callback<'OK'>): Result<'OK', Context>; failover(millisecondsToken: 'TIMEOUT', milliseconds: number, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -931,6 +1029,7 @@ interface RedisCommander { * Remove all keys from all databases * - _group_: server * - _complexity_: O(N) where N is the total number of keys in all databases + * - _since_: 1.0.0 */ flushall(callback?: Callback<'OK'>): Result<'OK', Context>; flushall(async: 'ASYNC', callback?: Callback<'OK'>): Result<'OK', Context>; @@ -940,6 +1039,7 @@ interface RedisCommander { * Remove all keys from the current database * - _group_: server * - _complexity_: O(N) where N is the number of keys in the selected database + * - _since_: 1.0.0 */ flushdb(callback?: Callback<'OK'>): Result<'OK', Context>; flushdb(async: 'ASYNC', callback?: Callback<'OK'>): Result<'OK', Context>; @@ -949,6 +1049,7 @@ interface RedisCommander { * Add one or more geospatial items in the geospatial index represented using a sorted set * - _group_: geo * - _complexity_: O(log(N)) for each item added, where N is the number of elements in the sorted set. + * - _since_: 3.2.0 */ geoadd(...args: [key: RedisKey, ...longitudeLatitudeMembers: (string | Buffer | number)[], callback: Callback]): Result; geoadd(...args: [key: RedisKey, ...longitudeLatitudeMembers: (string | Buffer | number)[]]): Result; @@ -967,6 +1068,7 @@ interface RedisCommander { * Returns the distance between two members of a geospatial index * - _group_: geo * - _complexity_: O(log(N)) + * - _since_: 3.2.0 */ geodist(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, callback?: Callback): Result; geodistBuffer(key: RedisKey, member1: string | Buffer | number, member2: string | Buffer | number, callback?: Callback): Result; @@ -983,6 +1085,7 @@ interface RedisCommander { * Returns members of a geospatial index as standard geohash strings * - _group_: geo * - _complexity_: O(log(N)) for each member requested, where N is the number of elements in the sorted set. + * - _since_: 3.2.0 */ geohash(...args: [key: RedisKey, ...members: (string | Buffer | number)[], callback: Callback]): Result; geohashBuffer(...args: [key: RedisKey, ...members: (string | Buffer | number)[], callback: Callback]): Result; @@ -997,6 +1100,7 @@ interface RedisCommander { * Returns longitude and latitude of members of a geospatial index * - _group_: geo * - _complexity_: O(N) where N is the number of members requested. + * - _since_: 3.2.0 */ geopos(...args: [key: RedisKey, ...members: (string | Buffer | number)[], callback: Callback]): Result; geopos(...args: [key: RedisKey, members: (string | Buffer | number)[], callback: Callback]): Result; @@ -1007,6 +1111,7 @@ interface RedisCommander { * Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point * - _group_: geo * - _complexity_: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. + * - _since_: 3.2.0 */ georadius(...args: [key: RedisKey, longitude: number | string, latitude: number | string, radius: number | string, ...args: (RedisValue)[], callback: Callback]): Result; georadius(...args: [key: RedisKey, longitude: number | string, latitude: number | string, radius: number | string, ...args: (RedisValue)[]]): Result; @@ -1015,6 +1120,7 @@ interface RedisCommander { * A read-only variant for GEORADIUS * - _group_: geo * - _complexity_: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. + * - _since_: 3.2.10 */ georadius_ro(...args: [key: RedisKey, longitude: number | string, latitude: number | string, radius: number | string, ...args: (RedisValue)[], callback: Callback]): Result; georadius_ro(...args: [key: RedisKey, longitude: number | string, latitude: number | string, radius: number | string, ...args: (RedisValue)[]]): Result; @@ -1023,6 +1129,7 @@ interface RedisCommander { * Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member * - _group_: geo * - _complexity_: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. + * - _since_: 3.2.0 */ georadiusbymember(...args: [key: RedisKey, member: string | Buffer | number, radius: number | string, ...args: (RedisValue)[], callback: Callback]): Result; georadiusbymember(...args: [key: RedisKey, member: string | Buffer | number, radius: number | string, ...args: (RedisValue)[]]): Result; @@ -1031,6 +1138,7 @@ interface RedisCommander { * A read-only variant for GEORADIUSBYMEMBER * - _group_: geo * - _complexity_: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. + * - _since_: 3.2.10 */ georadiusbymember_ro(...args: [key: RedisKey, member: string | Buffer | number, radius: number | string, ...args: (RedisValue)[], callback: Callback]): Result; georadiusbymember_ro(...args: [key: RedisKey, member: string | Buffer | number, radius: number | string, ...args: (RedisValue)[]]): Result; @@ -1039,6 +1147,7 @@ interface RedisCommander { * Query a sorted set representing a geospatial index to fetch members inside an area of a box or a circle. * - _group_: geo * - _complexity_: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape + * - _since_: 6.2.0 */ geosearch(...args: [key: RedisKey, ...args: (RedisValue)[], callback: Callback]): Result; geosearch(...args: [key: RedisKey, ...args: (RedisValue)[]]): Result; @@ -1047,6 +1156,7 @@ interface RedisCommander { * Query a sorted set representing a geospatial index to fetch members inside an area of a box or a circle, and store the result in another key. * - _group_: geo * - _complexity_: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape + * - _since_: 6.2.0 */ geosearchstore(...args: [destination: RedisKey, source: RedisKey, ...args: (RedisValue)[], callback: Callback]): Result; geosearchstore(...args: [destination: RedisKey, source: RedisKey, ...args: (RedisValue)[]]): Result; @@ -1055,6 +1165,7 @@ interface RedisCommander { * Get the value of a key * - _group_: string * - _complexity_: O(1) + * - _since_: 1.0.0 */ get(key: RedisKey, callback?: Callback): Result; getBuffer(key: RedisKey, callback?: Callback): Result; @@ -1063,6 +1174,7 @@ interface RedisCommander { * Returns the bit value at offset in the string value stored at key * - _group_: bitmap * - _complexity_: O(1) + * - _since_: 2.2.0 */ getbit(key: RedisKey, offset: number | string, callback?: Callback): Result; @@ -1070,6 +1182,7 @@ interface RedisCommander { * Get the value of a key and delete the key * - _group_: string * - _complexity_: O(1) + * - _since_: 6.2.0 */ getdel(key: RedisKey, callback?: Callback): Result; getdelBuffer(key: RedisKey, callback?: Callback): Result; @@ -1078,6 +1191,7 @@ interface RedisCommander { * Get the value of a key and optionally set its expiration * - _group_: string * - _complexity_: O(1) + * - _since_: 6.2.0 */ getex(key: RedisKey, callback?: Callback): Result; getexBuffer(key: RedisKey, callback?: Callback): Result; @@ -1096,6 +1210,7 @@ interface RedisCommander { * Get a substring of the string stored at a key * - _group_: string * - _complexity_: O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings. + * - _since_: 2.4.0 */ getrange(key: RedisKey, start: number, end: number, callback?: Callback): Result; getrangeBuffer(key: RedisKey, start: number, end: number, callback?: Callback): Result; @@ -1104,6 +1219,7 @@ interface RedisCommander { * Set the string value of a key and return its old value * - _group_: string * - _complexity_: O(1) + * - _since_: 1.0.0 */ getset(key: RedisKey, value: string | Buffer | number, callback?: Callback): Result; getsetBuffer(key: RedisKey, value: string | Buffer | number, callback?: Callback): Result; @@ -1112,6 +1228,7 @@ interface RedisCommander { * Delete one or more hash fields * - _group_: hash * - _complexity_: O(N) where N is the number of fields to be removed. + * - _since_: 2.0.0 */ hdel(...args: [key: RedisKey, ...fields: (string | Buffer)[], callback: Callback]): Result; hdel(...args: [key: RedisKey, ...fields: (string | Buffer)[]]): Result; @@ -1120,6 +1237,7 @@ interface RedisCommander { * Handshake with Redis * - _group_: connection * - _complexity_: O(1) + * - _since_: 6.0.0 */ hello(callback?: Callback): Result; hello(protover: number | string, callback?: Callback): Result; @@ -1131,6 +1249,7 @@ interface RedisCommander { * Determine if a hash field exists * - _group_: hash * - _complexity_: O(1) + * - _since_: 2.0.0 */ hexists(key: RedisKey, field: string | Buffer, callback?: Callback): Result; @@ -1138,6 +1257,7 @@ interface RedisCommander { * Get the value of a hash field * - _group_: hash * - _complexity_: O(1) + * - _since_: 2.0.0 */ hget(key: RedisKey, field: string | Buffer, callback?: Callback): Result; hgetBuffer(key: RedisKey, field: string | Buffer, callback?: Callback): Result; @@ -1146,6 +1266,7 @@ interface RedisCommander { * Get all the fields and values in a hash * - _group_: hash * - _complexity_: O(N) where N is the size of the hash. + * - _since_: 2.0.0 */ hgetall(key: RedisKey, callback?: Callback>): Result, Context> hgetallBuffer(key: RedisKey, callback?: Callback<[field: Buffer, value: Buffer][]>): Result<[field: Buffer, value: Buffer][], Context> @@ -1154,6 +1275,7 @@ interface RedisCommander { * Increment the integer value of a hash field by the given number * - _group_: hash * - _complexity_: O(1) + * - _since_: 2.0.0 */ hincrby(key: RedisKey, field: string | Buffer, increment: number | string, callback?: Callback): Result; @@ -1161,6 +1283,7 @@ interface RedisCommander { * Increment the float value of a hash field by the given amount * - _group_: hash * - _complexity_: O(1) + * - _since_: 2.6.0 */ hincrbyfloat(key: RedisKey, field: string | Buffer, increment: number | string, callback?: Callback): Result; hincrbyfloatBuffer(key: RedisKey, field: string | Buffer, increment: number | string, callback?: Callback): Result; @@ -1169,6 +1292,7 @@ interface RedisCommander { * Get all the fields in a hash * - _group_: hash * - _complexity_: O(N) where N is the size of the hash. + * - _since_: 2.0.0 */ hkeys(key: RedisKey, callback?: Callback): Result; hkeysBuffer(key: RedisKey, callback?: Callback): Result; @@ -1177,6 +1301,7 @@ interface RedisCommander { * Get the number of fields in a hash * - _group_: hash * - _complexity_: O(1) + * - _since_: 2.0.0 */ hlen(key: RedisKey, callback?: Callback): Result; @@ -1184,6 +1309,7 @@ interface RedisCommander { * Get the values of all the given hash fields * - _group_: hash * - _complexity_: O(N) where N is the number of fields being requested. + * - _since_: 2.0.0 */ hmget(...args: [key: RedisKey, ...fields: (string | Buffer)[], callback: Callback<(string | null)[]>]): Result<(string | null)[], Context>; hmgetBuffer(...args: [key: RedisKey, ...fields: (string | Buffer)[], callback: Callback<(Buffer | null)[]>]): Result<(Buffer | null)[], Context>; @@ -1194,6 +1320,7 @@ interface RedisCommander { * Set multiple hash fields to multiple values * - _group_: hash * - _complexity_: O(N) where N is the number of fields being set. + * - _since_: 2.0.0 */ hmset(key: RedisKey, object: Record, callback?: Callback<'OK'>): Result<'OK', Context> hmset(key: RedisKey, map: Map, callback?: Callback<'OK'>): Result<'OK', Context> @@ -1204,6 +1331,7 @@ interface RedisCommander { * Get one or multiple random fields from a hash * - _group_: hash * - _complexity_: O(N) where N is the number of fields returned + * - _since_: 6.2.0 */ hrandfield(key: RedisKey, callback?: Callback): Result; hrandfieldBuffer(key: RedisKey, callback?: Callback): Result; @@ -1216,6 +1344,7 @@ interface RedisCommander { * Incrementally iterate hash fields and associated values * - _group_: hash * - _complexity_: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.. + * - _since_: 2.8.0 */ hscan(key: RedisKey, cursor: number | string, callback?: Callback<[cursor: string, elements: string[]]>): Result<[cursor: string, elements: string[]], Context>; hscanBuffer(key: RedisKey, cursor: number | string, callback?: Callback<[cursor: Buffer, elements: Buffer[]]>): Result<[cursor: Buffer, elements: Buffer[]], Context>; @@ -1230,6 +1359,7 @@ interface RedisCommander { * Set the string value of a hash field * - _group_: hash * - _complexity_: O(1) for each field/value pair added, so O(N) to add N field/value pairs when the command is called with multiple field/value pairs. + * - _since_: 2.0.0 */ hset(key: RedisKey, object: Record, callback?: Callback): Result hset(key: RedisKey, map: Map, callback?: Callback): Result @@ -1240,6 +1370,7 @@ interface RedisCommander { * Set the value of a hash field, only if the field does not exist * - _group_: hash * - _complexity_: O(1) + * - _since_: 2.0.0 */ hsetnx(key: RedisKey, field: string | Buffer, value: string | Buffer | number, callback?: Callback): Result; @@ -1247,6 +1378,7 @@ interface RedisCommander { * Get the length of the value of a hash field * - _group_: hash * - _complexity_: O(1) + * - _since_: 3.2.0 */ hstrlen(key: RedisKey, field: string | Buffer, callback?: Callback): Result; @@ -1254,6 +1386,7 @@ interface RedisCommander { * Get all the values in a hash * - _group_: hash * - _complexity_: O(N) where N is the size of the hash. + * - _since_: 2.0.0 */ hvals(key: RedisKey, callback?: Callback): Result; hvalsBuffer(key: RedisKey, callback?: Callback): Result; @@ -1262,6 +1395,7 @@ interface RedisCommander { * Increment the integer value of a key by one * - _group_: string * - _complexity_: O(1) + * - _since_: 1.0.0 */ incr(key: RedisKey, callback?: Callback): Result; @@ -1269,6 +1403,7 @@ interface RedisCommander { * Increment the integer value of a key by the given amount * - _group_: string * - _complexity_: O(1) + * - _since_: 1.0.0 */ incrby(key: RedisKey, increment: number | string, callback?: Callback): Result; @@ -1276,6 +1411,7 @@ interface RedisCommander { * Increment the float value of a key by the given amount * - _group_: string * - _complexity_: O(1) + * - _since_: 2.6.0 */ incrbyfloat(key: RedisKey, increment: number | string, callback?: Callback): Result; @@ -1283,6 +1419,7 @@ interface RedisCommander { * Get information and statistics about the server * - _group_: server * - _complexity_: O(1) + * - _since_: 1.0.0 */ info(callback?: Callback): Result; info(section: string | Buffer, callback?: Callback): Result; @@ -1291,6 +1428,7 @@ interface RedisCommander { * Find all keys matching the given pattern * - _group_: generic * - _complexity_: O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have limited length. + * - _since_: 1.0.0 */ keys(pattern: string, callback?: Callback): Result; keysBuffer(pattern: string, callback?: Callback): Result; @@ -1299,6 +1437,7 @@ interface RedisCommander { * Get the UNIX time stamp of the last successful save to disk * - _group_: server * - _complexity_: O(1) + * - _since_: 1.0.0 */ lastsave(callback?: Callback): Result; @@ -1306,6 +1445,7 @@ interface RedisCommander { * Show helpful text about the different subcommands. * - _group_: server * - _complexity_: O(1) + * - _since_: 2.8.13 */ latency(subcommand: 'HELP', callback?: Callback): Result; @@ -1313,6 +1453,7 @@ interface RedisCommander { * Return a latency graph for the event. * - _group_: server * - _complexity_: O(1) + * - _since_: 2.8.13 */ latency(subcommand: 'GRAPH', event: string | Buffer, callback?: Callback): Result; @@ -1320,6 +1461,7 @@ interface RedisCommander { * Return a human readable latency analysis report. * - _group_: server * - _complexity_: O(1) + * - _since_: 2.8.13 */ latency(subcommand: 'DOCTOR', callback?: Callback): Result; @@ -1327,6 +1469,7 @@ interface RedisCommander { * Return the cumulative distribution of latencies of a subset of commands or all. * - _group_: server * - _complexity_: O(N) where N is the number of commands with latency information being retrieved. + * - _since_: 7.0.0 */ latency(subcommand: 'HISTOGRAM', callback?: Callback): Result; latency(...args: [subcommand: 'HISTOGRAM', ...commands: (string | Buffer)[], callback: Callback]): Result; @@ -1336,6 +1479,7 @@ interface RedisCommander { * Return the latest latency samples for all events. * - _group_: server * - _complexity_: O(1) + * - _since_: 2.8.13 */ latency(subcommand: 'LATEST', callback?: Callback): Result; @@ -1343,6 +1487,7 @@ interface RedisCommander { * Return timestamp-latency samples for the event. * - _group_: server * - _complexity_: O(1) + * - _since_: 2.8.13 */ latency(subcommand: 'HISTORY', event: string | Buffer, callback?: Callback): Result; @@ -1350,6 +1495,7 @@ interface RedisCommander { * Reset latency data for one or more events. * - _group_: server * - _complexity_: O(1) + * - _since_: 2.8.13 */ latency(subcommand: 'RESET', callback?: Callback): Result; latency(...args: [subcommand: 'RESET', ...events: (string | Buffer)[], callback: Callback]): Result; @@ -1359,6 +1505,7 @@ interface RedisCommander { * Get an element from a list by its index * - _group_: list * - _complexity_: O(N) where N is the number of elements to traverse to get to the element at index. This makes asking for the first or the last element of the list O(1). + * - _since_: 1.0.0 */ lindex(key: RedisKey, index: number, callback?: Callback): Result; lindexBuffer(key: RedisKey, index: number, callback?: Callback): Result; @@ -1367,6 +1514,7 @@ interface RedisCommander { * Insert an element before or after another element in a list * - _group_: list * - _complexity_: O(N) where N is the number of elements to traverse before seeing the value pivot. This means that inserting somewhere on the left end on the list (head) can be considered O(1) and inserting somewhere on the right end (tail) is O(N). + * - _since_: 2.2.0 */ linsert(key: RedisKey, before: 'BEFORE', pivot: string | Buffer | number, element: string | Buffer | number, callback?: Callback): Result; linsert(key: RedisKey, after: 'AFTER', pivot: string | Buffer | number, element: string | Buffer | number, callback?: Callback): Result; @@ -1375,6 +1523,7 @@ interface RedisCommander { * Get the length of a list * - _group_: list * - _complexity_: O(1) + * - _since_: 1.0.0 */ llen(key: RedisKey, callback?: Callback): Result; @@ -1382,6 +1531,7 @@ interface RedisCommander { * Pop an element from a list, push it to another list and return it * - _group_: list * - _complexity_: O(1) + * - _since_: 6.2.0 */ lmove(source: RedisKey, destination: RedisKey, left: 'LEFT', left1: 'LEFT', callback?: Callback): Result; lmoveBuffer(source: RedisKey, destination: RedisKey, left: 'LEFT', left1: 'LEFT', callback?: Callback): Result; @@ -1396,6 +1546,7 @@ interface RedisCommander { * Display some computer art and the Redis version * - _group_: server * - _complexity_: undefined + * - _since_: 5.0.0 */ lolwut(callback?: Callback): Result; lolwut(versionToken: 'VERSION', version: number | string, callback?: Callback): Result; @@ -1404,6 +1555,7 @@ interface RedisCommander { * Remove and get the first elements in a list * - _group_: list * - _complexity_: O(N) where N is the number of elements returned + * - _since_: 1.0.0 */ lpop(key: RedisKey, callback?: Callback): Result; lpopBuffer(key: RedisKey, callback?: Callback): Result; @@ -1414,6 +1566,7 @@ interface RedisCommander { * Return the index of matching elements on a list * - _group_: list * - _complexity_: O(N) where N is the number of elements in the list, for the average case. When searching for elements near the head or the tail of the list, or when the MAXLEN option is provided, the command may run in constant time. + * - _since_: 6.0.6 */ lpos(key: RedisKey, element: string | Buffer | number, callback?: Callback): Result; lpos(key: RedisKey, element: string | Buffer | number, lenToken: 'MAXLEN', len: number | string, callback?: Callback): Result; @@ -1428,6 +1581,7 @@ interface RedisCommander { * Prepend one or multiple elements to a list * - _group_: list * - _complexity_: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. + * - _since_: 1.0.0 */ lpush(...args: [key: RedisKey, ...elements: (string | Buffer | number)[], callback: Callback]): Result; lpush(...args: [key: RedisKey, ...elements: (string | Buffer | number)[]]): Result; @@ -1436,6 +1590,7 @@ interface RedisCommander { * Prepend an element to a list, only if the list exists * - _group_: list * - _complexity_: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. + * - _since_: 2.2.0 */ lpushx(...args: [key: RedisKey, ...elements: (string | Buffer | number)[], callback: Callback]): Result; lpushx(...args: [key: RedisKey, ...elements: (string | Buffer | number)[]]): Result; @@ -1444,6 +1599,7 @@ interface RedisCommander { * Get a range of elements from a list * - _group_: list * - _complexity_: O(S+N) where S is the distance of start offset from HEAD for small lists, from nearest end (HEAD or TAIL) for large lists; and N is the number of elements in the specified range. + * - _since_: 1.0.0 */ lrange(key: RedisKey, start: number, stop: number, callback?: Callback): Result; lrangeBuffer(key: RedisKey, start: number, stop: number, callback?: Callback): Result; @@ -1452,6 +1608,7 @@ interface RedisCommander { * Remove elements from a list * - _group_: list * - _complexity_: O(N+M) where N is the length of the list and M is the number of elements removed. + * - _since_: 1.0.0 */ lrem(key: RedisKey, count: number, element: string | Buffer | number, callback?: Callback): Result; @@ -1459,6 +1616,7 @@ interface RedisCommander { * Set the value of an element in a list by its index * - _group_: list * - _complexity_: O(N) where N is the length of the list. Setting either the first or the last element of the list is O(1). + * - _since_: 1.0.0 */ lset(key: RedisKey, index: number, element: string | Buffer | number, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -1466,6 +1624,7 @@ interface RedisCommander { * Trim a list to the specified range * - _group_: list * - _complexity_: O(N) where N is the number of elements to be removed by the operation. + * - _since_: 1.0.0 */ ltrim(key: RedisKey, start: number, stop: number, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -1473,6 +1632,7 @@ interface RedisCommander { * Show allocator internal stats * - _group_: server * - _complexity_: Depends on how much memory is allocated, could be slow + * - _since_: 4.0.0 */ memory(subcommand: 'MALLOC-STATS', callback?: Callback): Result; @@ -1480,6 +1640,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: server * - _complexity_: O(1) + * - _since_: 4.0.0 */ memory(subcommand: 'HELP', callback?: Callback): Result; @@ -1487,6 +1648,7 @@ interface RedisCommander { * Estimate the memory usage of a key * - _group_: server * - _complexity_: O(N) where N is the number of samples. + * - _since_: 4.0.0 */ memory(subcommand: 'USAGE', key: RedisKey, callback?: Callback): Result; memory(subcommand: 'USAGE', key: RedisKey, countToken: 'SAMPLES', count: number, callback?: Callback): Result; @@ -1495,6 +1657,7 @@ interface RedisCommander { * Show memory usage details * - _group_: server * - _complexity_: O(1) + * - _since_: 4.0.0 */ memory(subcommand: 'STATS', callback?: Callback): Result; @@ -1502,6 +1665,7 @@ interface RedisCommander { * Outputs memory problems report * - _group_: server * - _complexity_: O(1) + * - _since_: 4.0.0 */ memory(subcommand: 'DOCTOR', callback?: Callback): Result; @@ -1509,6 +1673,7 @@ interface RedisCommander { * Ask the allocator to release memory * - _group_: server * - _complexity_: Depends on how much memory is allocated, could be slow + * - _since_: 4.0.0 */ memory(subcommand: 'PURGE', callback?: Callback<"OK">): Result<"OK", Context>; @@ -1516,6 +1681,7 @@ interface RedisCommander { * Get the values of all the given keys * - _group_: string * - _complexity_: O(N) where N is the number of keys to retrieve. + * - _since_: 1.0.0 */ mget(...args: [...keys: (RedisKey)[], callback: Callback<(string | null)[]>]): Result<(string | null)[], Context>; mgetBuffer(...args: [...keys: (RedisKey)[], callback: Callback<(Buffer | null)[]>]): Result<(Buffer | null)[], Context>; @@ -1530,6 +1696,7 @@ interface RedisCommander { * Atomically transfer a key from a Redis instance to another one. * - _group_: generic * - _complexity_: This command actually executes a DUMP+DEL in the source instance, and a RESTORE in the target instance. See the pages of these commands for time complexity. Also an O(N) data transfer between the two instances is performed. + * - _since_: 2.6.0 */ migrate(...args: [host: string | Buffer, port: string | Buffer, ...args: (RedisValue)[], callback: Callback<'OK'>]): Result<'OK', Context>; migrate(...args: [host: string | Buffer, port: string | Buffer, ...args: (RedisValue)[]]): Result<'OK', Context>; @@ -1538,6 +1705,7 @@ interface RedisCommander { * List all modules loaded by the server * - _group_: server * - _complexity_: O(N) where N is the number of loaded modules. + * - _since_: 4.0.0 */ module(subcommand: 'LIST', callback?: Callback): Result; @@ -1545,6 +1713,7 @@ interface RedisCommander { * Unload a module * - _group_: server * - _complexity_: O(1) + * - _since_: 4.0.0 */ module(subcommand: 'UNLOAD', name: string | Buffer, callback?: Callback): Result; @@ -1552,6 +1721,7 @@ interface RedisCommander { * Load a module * - _group_: server * - _complexity_: O(1) + * - _since_: 4.0.0 */ module(subcommand: 'LOAD', path: string | Buffer, callback?: Callback): Result; module(...args: [subcommand: 'LOAD', path: string | Buffer, ...args: (string | Buffer | number)[], callback: Callback]): Result; @@ -1561,6 +1731,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: server * - _complexity_: O(1) + * - _since_: 5.0.0 */ module(subcommand: 'HELP', callback?: Callback): Result; @@ -1568,6 +1739,7 @@ interface RedisCommander { * Move a key to another database * - _group_: generic * - _complexity_: O(1) + * - _since_: 1.0.0 */ move(key: RedisKey, db: number | string, callback?: Callback): Result; @@ -1575,6 +1747,7 @@ interface RedisCommander { * Set multiple keys to multiple values * - _group_: string * - _complexity_: O(N) where N is the number of keys to set. + * - _since_: 1.0.1 */ mset(object: Record, callback?: Callback<'OK'>): Result<'OK', Context> mset(map: Map, callback?: Callback<'OK'>): Result<'OK', Context> @@ -1585,6 +1758,7 @@ interface RedisCommander { * Set multiple keys to multiple values, only if none of the keys exist * - _group_: string * - _complexity_: O(N) where N is the number of keys to set. + * - _since_: 1.0.1 */ msetnx(object: Record, callback?: Callback<'OK'>): Result<'OK', Context> msetnx(map: Map, callback?: Callback<'OK'>): Result<'OK', Context> @@ -1595,6 +1769,7 @@ interface RedisCommander { * Get the logarithmic access frequency counter of a Redis object * - _group_: generic * - _complexity_: O(1) + * - _since_: 4.0.0 */ object(subcommand: 'FREQ', key: RedisKey, callback?: Callback): Result; @@ -1602,6 +1777,7 @@ interface RedisCommander { * Get the time since a Redis object was last accessed * - _group_: generic * - _complexity_: O(1) + * - _since_: 2.2.3 */ object(subcommand: 'IDLETIME', key: RedisKey, callback?: Callback): Result; @@ -1609,6 +1785,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: generic * - _complexity_: O(1) + * - _since_: 6.2.0 */ object(subcommand: 'HELP', callback?: Callback): Result; @@ -1616,6 +1793,7 @@ interface RedisCommander { * Inspect the internal encoding of a Redis object * - _group_: generic * - _complexity_: O(1) + * - _since_: 2.2.3 */ object(subcommand: 'ENCODING', key: RedisKey, callback?: Callback): Result; @@ -1623,6 +1801,7 @@ interface RedisCommander { * Get the number of references to the value of the key * - _group_: generic * - _complexity_: O(1) + * - _since_: 2.2.3 */ object(subcommand: 'REFCOUNT', key: RedisKey, callback?: Callback): Result; @@ -1630,6 +1809,7 @@ interface RedisCommander { * Remove the expiration from a key * - _group_: generic * - _complexity_: O(1) + * - _since_: 2.2.0 */ persist(key: RedisKey, callback?: Callback): Result; @@ -1637,6 +1817,7 @@ interface RedisCommander { * Set a key's time to live in milliseconds * - _group_: generic * - _complexity_: O(1) + * - _since_: 2.6.0 */ pexpire(key: RedisKey, milliseconds: number, callback?: Callback): Result; pexpire(key: RedisKey, milliseconds: number, nx: 'NX', callback?: Callback): Result; @@ -1648,6 +1829,7 @@ interface RedisCommander { * Set the expiration for a key as a UNIX timestamp specified in milliseconds * - _group_: generic * - _complexity_: O(1) + * - _since_: 2.6.0 */ pexpireat(key: RedisKey, unixTimeMilliseconds: number, callback?: Callback): Result; pexpireat(key: RedisKey, unixTimeMilliseconds: number, nx: 'NX', callback?: Callback): Result; @@ -1659,6 +1841,7 @@ interface RedisCommander { * Adds the specified elements to the specified HyperLogLog. * - _group_: hyperloglog * - _complexity_: O(1) to add every element. + * - _since_: 2.8.9 */ pfadd(key: RedisKey, callback?: Callback): Result; pfadd(...args: [key: RedisKey, ...elements: (string | Buffer | number)[], callback: Callback]): Result; @@ -1668,6 +1851,7 @@ interface RedisCommander { * Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). * - _group_: hyperloglog * - _complexity_: O(1) with a very small average constant time when called with a single key. O(N) with N being the number of keys, and much bigger constant times, when called with multiple keys. + * - _since_: 2.8.9 */ pfcount(...args: [...keys: (RedisKey)[], callback: Callback]): Result; pfcount(...args: [keys: (RedisKey)[], callback: Callback]): Result; @@ -1678,6 +1862,7 @@ interface RedisCommander { * Internal commands for debugging HyperLogLog values * - _group_: hyperloglog * - _complexity_: N/A + * - _since_: 2.8.9 */ pfdebug(callback?: Callback): Result; @@ -1685,6 +1870,7 @@ interface RedisCommander { * Merge N different HyperLogLogs into a single one. * - _group_: hyperloglog * - _complexity_: O(N) to merge N HyperLogLogs, but with high constant times. + * - _since_: 2.8.9 */ pfmerge(...args: [destkey: RedisKey, ...sourcekeys: (RedisKey)[], callback: Callback<'OK'>]): Result<'OK', Context>; pfmerge(...args: [destkey: RedisKey, sourcekeys: (RedisKey)[], callback: Callback<'OK'>]): Result<'OK', Context>; @@ -1695,6 +1881,7 @@ interface RedisCommander { * An internal command for testing HyperLogLog values * - _group_: hyperloglog * - _complexity_: N/A + * - _since_: 2.8.9 */ pfselftest(callback?: Callback): Result; @@ -1702,6 +1889,7 @@ interface RedisCommander { * Ping the server * - _group_: connection * - _complexity_: O(1) + * - _since_: 1.0.0 */ ping(callback?: Callback<'PONG'>): Result<'PONG', Context>; ping(message: string | Buffer, callback?: Callback): Result; @@ -1711,6 +1899,7 @@ interface RedisCommander { * Set the value and expiration in milliseconds of a key * - _group_: string * - _complexity_: O(1) + * - _since_: 2.6.0 */ psetex(key: RedisKey, milliseconds: number, value: string | Buffer | number, callback?: Callback): Result; @@ -1718,6 +1907,7 @@ interface RedisCommander { * Listen for messages published to channels matching the given patterns * - _group_: pubsub * - _complexity_: O(N) where N is the number of patterns the client is already subscribed to. + * - _since_: 2.0.0 */ psubscribe(...args: [...patterns: (string)[], callback: Callback]): Result; psubscribe(...args: [...patterns: (string)[]]): Result; @@ -1726,6 +1916,7 @@ interface RedisCommander { * Internal command used for replication * - _group_: server * - _complexity_: undefined + * - _since_: 2.8.0 */ psync(replicationid: number | string, offset: number | string, callback?: Callback): Result; @@ -1733,6 +1924,7 @@ interface RedisCommander { * Get the time to live for a key in milliseconds * - _group_: generic * - _complexity_: O(1) + * - _since_: 2.6.0 */ pttl(key: RedisKey, callback?: Callback): Result; @@ -1740,6 +1932,7 @@ interface RedisCommander { * Post a message to a channel * - _group_: pubsub * - _complexity_: O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client). + * - _since_: 2.0.0 */ publish(channel: string | Buffer, message: string | Buffer, callback?: Callback): Result; @@ -1747,6 +1940,7 @@ interface RedisCommander { * Get the count of subscribers for channels * - _group_: pubsub * - _complexity_: O(N) for the NUMSUB subcommand, where N is the number of requested channels + * - _since_: 2.8.0 */ pubsub(subcommand: 'NUMSUB', callback?: Callback): Result; pubsub(...args: [subcommand: 'NUMSUB', ...channels: (string | Buffer)[], callback: Callback]): Result; @@ -1756,6 +1950,7 @@ interface RedisCommander { * Get the count of unique patterns pattern subscriptions * - _group_: pubsub * - _complexity_: O(1) + * - _since_: 2.8.0 */ pubsub(subcommand: 'NUMPAT', callback?: Callback): Result; @@ -1763,6 +1958,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: pubsub * - _complexity_: O(1) + * - _since_: 6.2.0 */ pubsub(subcommand: 'HELP', callback?: Callback): Result; @@ -1770,6 +1966,7 @@ interface RedisCommander { * Get the count of subscribers for shard channels * - _group_: pubsub * - _complexity_: O(N) for the SHARDNUMSUB subcommand, where N is the number of requested channels + * - _since_: 7.0.0 */ pubsub(subcommand: 'SHARDNUMSUB', callback?: Callback): Result; @@ -1777,6 +1974,7 @@ interface RedisCommander { * List active channels * - _group_: pubsub * - _complexity_: O(N) where N is the number of active channels, and assuming constant time pattern matching (relatively short channels and patterns) + * - _since_: 2.8.0 */ pubsub(subcommand: 'CHANNELS', callback?: Callback): Result; pubsub(subcommand: 'CHANNELS', pattern: string | Buffer, callback?: Callback): Result; @@ -1785,6 +1983,7 @@ interface RedisCommander { * List active shard channels * - _group_: pubsub * - _complexity_: O(N) where N is the number of active shard channels, and assuming constant time pattern matching (relatively short channels). + * - _since_: 7.0.0 */ pubsub(subcommand: 'SHARDCHANNELS', callback?: Callback): Result; pubsub(subcommand: 'SHARDCHANNELS', pattern: string | Buffer, callback?: Callback): Result; @@ -1793,6 +1992,7 @@ interface RedisCommander { * Stop listening for messages posted to channels matching the given patterns * - _group_: pubsub * - _complexity_: O(N+M) where N is the number of patterns the client is already subscribed and M is the number of total patterns subscribed in the system (by any client). + * - _since_: 2.0.0 */ punsubscribe(callback?: Callback): Result; punsubscribe(...args: [...patterns: (string)[], callback: Callback]): Result; @@ -1802,6 +2002,7 @@ interface RedisCommander { * Close the connection * - _group_: connection * - _complexity_: O(1) + * - _since_: 1.0.0 */ quit(callback?: Callback<'OK'>): Result<'OK', Context>; @@ -1809,6 +2010,7 @@ interface RedisCommander { * Return a random key from the keyspace * - _group_: generic * - _complexity_: O(1) + * - _since_: 1.0.0 */ randomkey(callback?: Callback): Result; randomkeyBuffer(callback?: Callback): Result; @@ -1817,6 +2019,7 @@ interface RedisCommander { * Enables read queries for a connection to a cluster replica node * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ readonly(callback?: Callback<'OK'>): Result<'OK', Context>; @@ -1824,6 +2027,7 @@ interface RedisCommander { * Disables read queries for a connection to a cluster replica node * - _group_: cluster * - _complexity_: O(1) + * - _since_: 3.0.0 */ readwrite(callback?: Callback<'OK'>): Result<'OK', Context>; @@ -1831,6 +2035,7 @@ interface RedisCommander { * Rename a key * - _group_: generic * - _complexity_: O(1) + * - _since_: 1.0.0 */ rename(key: RedisKey, newkey: RedisKey, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -1838,6 +2043,7 @@ interface RedisCommander { * Rename a key, only if the new key does not exist * - _group_: generic * - _complexity_: O(1) + * - _since_: 1.0.0 */ renamenx(key: RedisKey, newkey: RedisKey, callback?: Callback): Result; @@ -1845,6 +2051,7 @@ interface RedisCommander { * An internal command for configuring the replication stream * - _group_: server * - _complexity_: O(1) + * - _since_: 3.0.0 */ replconf(callback?: Callback): Result; @@ -1852,6 +2059,7 @@ interface RedisCommander { * Make the server a replica of another instance, or promote it as master. * - _group_: server * - _complexity_: O(1) + * - _since_: 5.0.0 */ replicaof(host: string | Buffer, port: string | Buffer, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -1859,6 +2067,7 @@ interface RedisCommander { * Reset the connection * - _group_: connection * - _complexity_: O(1) + * - _since_: 6.2.0 */ reset(callback?: Callback<'OK'>): Result<'OK', Context>; @@ -1866,6 +2075,7 @@ interface RedisCommander { * Create a key using the provided serialized value, previously obtained using DUMP. * - _group_: generic * - _complexity_: O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, 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(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)). + * - _since_: 2.6.0 */ restore(key: RedisKey, ttl: number | string, serializedValue: string | Buffer | number, callback?: Callback<'OK'>): Result<'OK', Context>; restore(key: RedisKey, ttl: number | string, serializedValue: string | Buffer | number, frequencyToken: 'FREQ', frequency: number | string, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -1888,6 +2098,7 @@ interface RedisCommander { * An internal command for migrating keys in a cluster * - _group_: server * - _complexity_: O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, 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(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)). + * - _since_: 3.0.0 */ ['restore-asking'](callback?: Callback): Result; @@ -1895,6 +2106,7 @@ interface RedisCommander { * Return the role of the instance in the context of replication * - _group_: server * - _complexity_: O(1) + * - _since_: 2.8.12 */ role(callback?: Callback): Result; @@ -1902,6 +2114,7 @@ interface RedisCommander { * Remove and get the last elements in a list * - _group_: list * - _complexity_: O(N) where N is the number of elements returned + * - _since_: 1.0.0 */ rpop(key: RedisKey, callback?: Callback): Result; rpopBuffer(key: RedisKey, callback?: Callback): Result; @@ -1912,6 +2125,7 @@ interface RedisCommander { * Remove the last element in a list, prepend it to another list and return it * - _group_: list * - _complexity_: O(1) + * - _since_: 1.2.0 */ rpoplpush(source: RedisKey, destination: RedisKey, callback?: Callback): Result; rpoplpushBuffer(source: RedisKey, destination: RedisKey, callback?: Callback): Result; @@ -1920,6 +2134,7 @@ interface RedisCommander { * Append one or multiple elements to a list * - _group_: list * - _complexity_: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. + * - _since_: 1.0.0 */ rpush(...args: [key: RedisKey, ...elements: (string | Buffer | number)[], callback: Callback]): Result; rpush(...args: [key: RedisKey, ...elements: (string | Buffer | number)[]]): Result; @@ -1928,6 +2143,7 @@ interface RedisCommander { * Append an element to a list, only if the list exists * - _group_: list * - _complexity_: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. + * - _since_: 2.2.0 */ rpushx(...args: [key: RedisKey, ...elements: (string | Buffer | number)[], callback: Callback]): Result; rpushx(...args: [key: RedisKey, ...elements: (string | Buffer | number)[]]): Result; @@ -1936,6 +2152,7 @@ interface RedisCommander { * Add one or more members to a set * - _group_: set * - _complexity_: O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. + * - _since_: 1.0.0 */ sadd(...args: [key: RedisKey, ...members: (string | Buffer | number)[], callback: Callback]): Result; sadd(...args: [key: RedisKey, members: (string | Buffer | number)[], callback: Callback]): Result; @@ -1946,6 +2163,7 @@ interface RedisCommander { * Synchronously save the dataset to disk * - _group_: server * - _complexity_: O(N) where N is the total number of keys in all databases + * - _since_: 1.0.0 */ save(callback?: Callback<'OK'>): Result<'OK', Context>; @@ -1953,6 +2171,7 @@ interface RedisCommander { * Incrementally iterate the keys space * - _group_: generic * - _complexity_: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection. + * - _since_: 2.8.0 */ scan(cursor: number | string, callback?: Callback<[cursor: string, elements: string[]]>): Result<[cursor: string, elements: string[]], Context>; scanBuffer(cursor: number | string, callback?: Callback<[cursor: Buffer, elements: Buffer[]]>): Result<[cursor: Buffer, elements: Buffer[]], Context>; @@ -1975,6 +2194,7 @@ interface RedisCommander { * Get the number of members in a set * - _group_: set * - _complexity_: O(1) + * - _since_: 1.0.0 */ scard(key: RedisKey, callback?: Callback): Result; @@ -1982,6 +2202,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: scripting * - _complexity_: O(1) + * - _since_: 5.0.0 */ script(subcommand: 'HELP', callback?: Callback): Result; @@ -1989,6 +2210,7 @@ interface RedisCommander { * Remove all the scripts from the script cache. * - _group_: scripting * - _complexity_: O(N) with N being the number of scripts in cache + * - _since_: 2.6.0 */ script(subcommand: 'FLUSH', callback?: Callback): Result; script(subcommand: 'FLUSH', async: 'ASYNC', callback?: Callback): Result; @@ -1998,6 +2220,7 @@ interface RedisCommander { * Check existence of scripts in the script cache. * - _group_: scripting * - _complexity_: O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation). + * - _since_: 2.6.0 */ script(...args: [subcommand: 'EXISTS', ...sha1s: (string | Buffer)[], callback: Callback]): Result; script(...args: [subcommand: 'EXISTS', ...sha1s: (string | Buffer)[]]): Result; @@ -2006,6 +2229,7 @@ interface RedisCommander { * Set the debug mode for executed scripts. * - _group_: scripting * - _complexity_: O(1) + * - _since_: 3.2.0 */ script(subcommand: 'DEBUG', yes: 'YES', callback?: Callback): Result; script(subcommand: 'DEBUG', sync: 'SYNC', callback?: Callback): Result; @@ -2015,6 +2239,7 @@ interface RedisCommander { * Load the specified Lua script into the script cache. * - _group_: scripting * - _complexity_: O(N) with N being the length in bytes of the script body. + * - _since_: 2.6.0 */ script(subcommand: 'LOAD', script: string | Buffer, callback?: Callback): Result; @@ -2022,6 +2247,7 @@ interface RedisCommander { * Kill the script currently in execution. * - _group_: scripting * - _complexity_: O(1) + * - _since_: 2.6.0 */ script(subcommand: 'KILL', callback?: Callback): Result; @@ -2029,6 +2255,7 @@ interface RedisCommander { * Subtract multiple sets * - _group_: set * - _complexity_: O(N) where N is the total number of elements in all given sets. + * - _since_: 1.0.0 */ sdiff(...args: [...keys: (RedisKey)[], callback: Callback]): Result; sdiffBuffer(...args: [...keys: (RedisKey)[], callback: Callback]): Result; @@ -2043,6 +2270,7 @@ interface RedisCommander { * Subtract multiple sets and store the resulting set in a key * - _group_: set * - _complexity_: O(N) where N is the total number of elements in all given sets. + * - _since_: 1.0.0 */ sdiffstore(...args: [destination: RedisKey, ...keys: (RedisKey)[], callback: Callback]): Result; sdiffstore(...args: [destination: RedisKey, keys: (RedisKey)[], callback: Callback]): Result; @@ -2053,6 +2281,7 @@ interface RedisCommander { * Change the selected database for the current connection * - _group_: connection * - _complexity_: O(1) + * - _since_: 1.0.0 */ select(index: number, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -2060,6 +2289,7 @@ interface RedisCommander { * Set the string value of a key * - _group_: string * - _complexity_: O(1) + * - _since_: 1.0.0 */ set(key: RedisKey, value: string | Buffer | number, callback?: Callback<'OK'>): Result<'OK', Context>; set(key: RedisKey, value: string | Buffer | number, get: 'GET', callback?: Callback): Result; @@ -2120,6 +2350,7 @@ interface RedisCommander { * Sets or clears the bit at offset in the string value stored at key * - _group_: bitmap * - _complexity_: O(1) + * - _since_: 2.2.0 */ setbit(key: RedisKey, offset: number | string, value: number | string, callback?: Callback): Result; @@ -2127,6 +2358,7 @@ interface RedisCommander { * Set the value and expiration of a key * - _group_: string * - _complexity_: O(1) + * - _since_: 2.0.0 */ setex(key: RedisKey, seconds: number, value: string | Buffer | number, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -2134,6 +2366,7 @@ interface RedisCommander { * Set the value of a key, only if the key does not exist * - _group_: string * - _complexity_: O(1) + * - _since_: 1.0.0 */ setnx(key: RedisKey, value: string | Buffer | number, callback?: Callback): Result; @@ -2141,6 +2374,7 @@ interface RedisCommander { * Overwrite part of a string at key starting at the specified offset * - _group_: string * - _complexity_: O(1), not counting the time taken to copy the new string in place. Usually, this string is very small so the amortized complexity is O(1). Otherwise, complexity is O(M) with M being the length of the value argument. + * - _since_: 2.2.0 */ setrange(key: RedisKey, offset: number | string, value: string | Buffer | number, callback?: Callback): Result; @@ -2148,6 +2382,7 @@ interface RedisCommander { * Synchronously save the dataset to disk and then shut down the server * - _group_: server * - _complexity_: O(N) when saving, where N is the total number of keys in all databases when saving data, otherwise O(1) + * - _since_: 1.0.0 */ shutdown(callback?: Callback<'OK'>): Result<'OK', Context>; shutdown(abort: 'ABORT', callback?: Callback<'OK'>): Result<'OK', Context>; @@ -2178,6 +2413,7 @@ interface RedisCommander { * Intersect multiple sets * - _group_: set * - _complexity_: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. + * - _since_: 1.0.0 */ sinter(...args: [...keys: (RedisKey)[], callback: Callback]): Result; sinterBuffer(...args: [...keys: (RedisKey)[], callback: Callback]): Result; @@ -2192,6 +2428,7 @@ interface RedisCommander { * Intersect multiple sets and store the resulting set in a key * - _group_: set * - _complexity_: O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. + * - _since_: 1.0.0 */ sinterstore(...args: [destination: RedisKey, ...keys: (RedisKey)[], callback: Callback]): Result; sinterstore(...args: [destination: RedisKey, keys: (RedisKey)[], callback: Callback]): Result; @@ -2202,6 +2439,7 @@ interface RedisCommander { * Determine if a given value is a member of a set * - _group_: set * - _complexity_: O(1) + * - _since_: 1.0.0 */ sismember(key: RedisKey, member: string | Buffer | number, callback?: Callback): Result; @@ -2209,6 +2447,7 @@ interface RedisCommander { * Make the server a replica of another instance, or promote it as master. Deprecated starting with Redis 5. Use REPLICAOF instead. * - _group_: server * - _complexity_: O(1) + * - _since_: 1.0.0 */ slaveof(host: string | Buffer, port: string | Buffer, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -2216,6 +2455,7 @@ interface RedisCommander { * Get the slow log's length * - _group_: server * - _complexity_: O(1) + * - _since_: 2.2.12 */ slowlog(subcommand: 'LEN', callback?: Callback): Result; @@ -2223,6 +2463,7 @@ interface RedisCommander { * Clear all entries from the slow log * - _group_: server * - _complexity_: O(N) where N is the number of entries in the slowlog + * - _since_: 2.2.12 */ slowlog(subcommand: 'RESET', callback?: Callback): Result; @@ -2230,6 +2471,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: server * - _complexity_: O(1) + * - _since_: 6.2.0 */ slowlog(subcommand: 'HELP', callback?: Callback): Result; @@ -2237,6 +2479,7 @@ interface RedisCommander { * Get the slow log's entries * - _group_: server * - _complexity_: O(N) where N is the number of entries returned + * - _since_: 2.2.12 */ slowlog(subcommand: 'GET', callback?: Callback): Result; slowlog(subcommand: 'GET', count: number, callback?: Callback): Result; @@ -2245,6 +2488,7 @@ interface RedisCommander { * Get all the members in a set * - _group_: set * - _complexity_: O(N) where N is the set cardinality. + * - _since_: 1.0.0 */ smembers(key: RedisKey, callback?: Callback): Result; smembersBuffer(key: RedisKey, callback?: Callback): Result; @@ -2253,6 +2497,7 @@ interface RedisCommander { * Returns the membership associated with the given elements for a set * - _group_: set * - _complexity_: O(N) where N is the number of elements being checked for membership + * - _since_: 6.2.0 */ smismember(...args: [key: RedisKey, ...members: (string | Buffer | number)[], callback: Callback]): Result; smismember(...args: [key: RedisKey, members: (string | Buffer | number)[], callback: Callback]): Result; @@ -2263,6 +2508,7 @@ interface RedisCommander { * Move a member from one set to another * - _group_: set * - _complexity_: O(1) + * - _since_: 1.0.0 */ smove(source: RedisKey, destination: RedisKey, member: string | Buffer | number, callback?: Callback): Result; @@ -2270,6 +2516,7 @@ interface RedisCommander { * Sort the elements in a list, set or sorted set * - _group_: generic * - _complexity_: O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N). + * - _since_: 1.0.0 */ sort(...args: [key: RedisKey, ...args: (RedisValue)[], callback: Callback]): Result; sort(...args: [key: RedisKey, ...args: (RedisValue)[]]): Result; @@ -2278,6 +2525,7 @@ interface RedisCommander { * Remove and return one or multiple random members from a set * - _group_: set * - _complexity_: Without the count argument O(1), otherwise O(N) where N is the value of the passed count. + * - _since_: 1.0.0 */ spop(key: RedisKey, callback?: Callback): Result; spopBuffer(key: RedisKey, callback?: Callback): Result; @@ -2288,6 +2536,7 @@ interface RedisCommander { * Get one or multiple random members from a set * - _group_: set * - _complexity_: Without the count argument O(1), otherwise O(N) where N is the absolute value of the passed count. + * - _since_: 1.0.0 */ srandmember(key: RedisKey, callback?: Callback): Result; srandmemberBuffer(key: RedisKey, callback?: Callback): Result; @@ -2298,6 +2547,7 @@ interface RedisCommander { * Remove one or more members from a set * - _group_: set * - _complexity_: O(N) where N is the number of members to be removed. + * - _since_: 1.0.0 */ srem(...args: [key: RedisKey, ...members: (string | Buffer | number)[], callback: Callback]): Result; srem(...args: [key: RedisKey, members: (string | Buffer | number)[], callback: Callback]): Result; @@ -2308,6 +2558,7 @@ interface RedisCommander { * Incrementally iterate Set elements * - _group_: set * - _complexity_: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.. + * - _since_: 2.8.0 */ sscan(key: RedisKey, cursor: number | string, callback?: Callback<[cursor: string, elements: string[]]>): Result<[cursor: string, elements: string[]], Context>; sscanBuffer(key: RedisKey, cursor: number | string, callback?: Callback<[cursor: Buffer, elements: Buffer[]]>): Result<[cursor: Buffer, elements: Buffer[]], Context>; @@ -2322,6 +2573,7 @@ interface RedisCommander { * Get the length of the value stored in a key * - _group_: string * - _complexity_: O(1) + * - _since_: 2.2.0 */ strlen(key: RedisKey, callback?: Callback): Result; @@ -2329,6 +2581,7 @@ interface RedisCommander { * Listen for messages published to the given channels * - _group_: pubsub * - _complexity_: O(N) where N is the number of channels to subscribe to. + * - _since_: 2.0.0 */ subscribe(...args: [...channels: (string | Buffer)[], callback: Callback]): Result; subscribe(...args: [...channels: (string | Buffer)[]]): Result; @@ -2337,6 +2590,7 @@ interface RedisCommander { * Get a substring of the string stored at a key * - _group_: string * - _complexity_: O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings. + * - _since_: 1.0.0 */ substr(key: RedisKey, start: number, end: number, callback?: Callback): Result; @@ -2344,6 +2598,7 @@ interface RedisCommander { * Add multiple sets * - _group_: set * - _complexity_: O(N) where N is the total number of elements in all given sets. + * - _since_: 1.0.0 */ sunion(...args: [...keys: (RedisKey)[], callback: Callback]): Result; sunionBuffer(...args: [...keys: (RedisKey)[], callback: Callback]): Result; @@ -2358,6 +2613,7 @@ interface RedisCommander { * Add multiple sets and store the resulting set in a key * - _group_: set * - _complexity_: O(N) where N is the total number of elements in all given sets. + * - _since_: 1.0.0 */ sunionstore(...args: [destination: RedisKey, ...keys: (RedisKey)[], callback: Callback]): Result; sunionstore(...args: [destination: RedisKey, keys: (RedisKey)[], callback: Callback]): Result; @@ -2368,6 +2624,7 @@ interface RedisCommander { * Swaps two Redis databases * - _group_: server * - _complexity_: O(N) where N is the count of clients watching or blocking on keys from both databases. + * - _since_: 4.0.0 */ swapdb(index1: number, index2: number, callback?: Callback<'OK'>): Result<'OK', Context>; @@ -2375,6 +2632,7 @@ interface RedisCommander { * Internal command used for replication * - _group_: server * - _complexity_: undefined + * - _since_: 1.0.0 */ sync(callback?: Callback): Result; @@ -2382,6 +2640,7 @@ interface RedisCommander { * Return the current server time * - _group_: server * - _complexity_: O(1) + * - _since_: 2.6.0 */ time(callback?: Callback): Result; @@ -2389,6 +2648,7 @@ interface RedisCommander { * Alters the last access time of a key(s). Returns the number of existing keys specified. * - _group_: generic * - _complexity_: O(N) where N is the number of keys that will be touched. + * - _since_: 3.2.1 */ touch(...args: [...keys: (RedisKey)[], callback: Callback]): Result; touch(...args: [keys: (RedisKey)[], callback: Callback]): Result; @@ -2399,6 +2659,7 @@ interface RedisCommander { * Get the time to live for a key in seconds * - _group_: generic * - _complexity_: O(1) + * - _since_: 1.0.0 */ ttl(key: RedisKey, callback?: Callback): Result; @@ -2406,6 +2667,7 @@ interface RedisCommander { * Determine the type stored at key * - _group_: generic * - _complexity_: O(1) + * - _since_: 1.0.0 */ type(key: RedisKey, callback?: Callback): Result; @@ -2413,6 +2675,7 @@ interface RedisCommander { * Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking. * - _group_: generic * - _complexity_: O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of. + * - _since_: 4.0.0 */ unlink(...args: [...keys: (RedisKey)[], callback: Callback]): Result; unlink(...args: [keys: (RedisKey)[], callback: Callback]): Result; @@ -2423,6 +2686,7 @@ interface RedisCommander { * Stop listening for messages posted to the given channels * - _group_: pubsub * - _complexity_: O(N) where N is the number of clients already subscribed to a channel. + * - _since_: 2.0.0 */ unsubscribe(callback?: Callback): Result; unsubscribe(...args: [...channels: (string | Buffer)[], callback: Callback]): Result; @@ -2432,6 +2696,7 @@ interface RedisCommander { * Forget about all watched keys * - _group_: transactions * - _complexity_: O(1) + * - _since_: 2.2.0 */ unwatch(callback?: Callback<'OK'>): Result<'OK', Context>; @@ -2439,6 +2704,7 @@ interface RedisCommander { * Wait for the synchronous replication of all the write commands sent in the context of the current connection * - _group_: generic * - _complexity_: O(1) + * - _since_: 3.0.0 */ wait(numreplicas: number | string, timeout: number | string, callback?: Callback): Result; @@ -2446,6 +2712,7 @@ interface RedisCommander { * Watch the given keys to determine execution of the MULTI/EXEC block * - _group_: transactions * - _complexity_: O(1) for every key. + * - _since_: 2.2.0 */ watch(...args: [...keys: (RedisKey)[], callback: Callback<'OK'>]): Result<'OK', Context>; watch(...args: [keys: (RedisKey)[], callback: Callback<'OK'>]): Result<'OK', Context>; @@ -2456,6 +2723,7 @@ interface RedisCommander { * Marks a pending message as correctly processed, effectively removing it from the pending entries list of the consumer group. Return value of the command is the number of messages successfully acknowledged, that is, the IDs we were actually able to resolve in the PEL. * - _group_: stream * - _complexity_: O(1) for each message ID processed. + * - _since_: 5.0.0 */ xack(...args: [key: RedisKey, group: string | Buffer, ...ids: (string | Buffer | number)[], callback: Callback]): Result; xack(...args: [key: RedisKey, group: string | Buffer, ...ids: (string | Buffer | number)[]]): Result; @@ -2464,6 +2732,7 @@ interface RedisCommander { * Appends a new entry to a stream * - _group_: stream * - _complexity_: O(1) when adding a new entry, O(N) when trimming where N being the number of entries evicted. + * - _since_: 5.0.0 */ xadd(...args: [key: RedisKey, ...args: (RedisValue)[], callback: Callback]): Result; xaddBuffer(...args: [key: RedisKey, ...args: (RedisValue)[], callback: Callback]): Result; @@ -2474,6 +2743,7 @@ interface RedisCommander { * Changes (or acquires) ownership of messages in a consumer group, as if the messages were delivered to the specified consumer. * - _group_: stream * - _complexity_: O(1) if COUNT is small. + * - _since_: 6.2.0 */ xautoclaim(key: RedisKey, group: string | Buffer, consumer: string | Buffer, minIdleTime: string | Buffer | number, start: string | Buffer | number, callback?: Callback): Result; xautoclaim(key: RedisKey, group: string | Buffer, consumer: string | Buffer, minIdleTime: string | Buffer | number, start: string | Buffer | number, justid: 'JUSTID', callback?: Callback): Result; @@ -2484,6 +2754,7 @@ interface RedisCommander { * Changes (or acquires) ownership of a message in a consumer group, as if the message was delivered to the specified consumer. * - _group_: stream * - _complexity_: O(log N) with N being the number of messages in the PEL of the consumer group. + * - _since_: 5.0.0 */ xclaim(...args: [key: RedisKey, group: string | Buffer, consumer: string | Buffer, minIdleTime: string | Buffer | number, ...ids: (string | Buffer | number)[], callback: Callback]): Result; xclaim(...args: [key: RedisKey, group: string | Buffer, consumer: string | Buffer, minIdleTime: string | Buffer | number, ...ids: (string | Buffer | number)[]]): Result; @@ -2554,6 +2825,7 @@ interface RedisCommander { * Removes the specified entries from the stream. Returns the number of items actually deleted, that may be different from the number of IDs passed in case certain IDs do not exist. * - _group_: stream * - _complexity_: O(1) for each single item to delete in the stream, regardless of the stream size. + * - _since_: 5.0.0 */ xdel(...args: [key: RedisKey, ...ids: (string | Buffer | number)[], callback: Callback]): Result; xdel(...args: [key: RedisKey, ...ids: (string | Buffer | number)[]]): Result; @@ -2562,6 +2834,7 @@ interface RedisCommander { * Destroy a consumer group. * - _group_: stream * - _complexity_: O(N) where N is the number of entries in the group's pending entries list (PEL). + * - _since_: 5.0.0 */ xgroup(subcommand: 'DESTROY', key: RedisKey, groupname: string | Buffer, callback?: Callback): Result; @@ -2569,6 +2842,7 @@ interface RedisCommander { * Create a consumer group. * - _group_: stream * - _complexity_: O(1) + * - _since_: 5.0.0 */ xgroup(subcommand: 'CREATE', key: RedisKey, groupname: string | Buffer, id: string | Buffer | number, callback?: Callback): Result; xgroup(subcommand: 'CREATE', key: RedisKey, groupname: string | Buffer, id: string | Buffer | number, mkstream: 'MKSTREAM', callback?: Callback): Result; @@ -2579,6 +2853,7 @@ interface RedisCommander { * Delete a consumer from a consumer group. * - _group_: stream * - _complexity_: O(1) + * - _since_: 5.0.0 */ xgroup(subcommand: 'DELCONSUMER', key: RedisKey, groupname: string | Buffer, consumername: string | Buffer, callback?: Callback): Result; @@ -2586,6 +2861,7 @@ interface RedisCommander { * Create a consumer in a consumer group. * - _group_: stream * - _complexity_: O(1) + * - _since_: 6.2.0 */ xgroup(subcommand: 'CREATECONSUMER', key: RedisKey, groupname: string | Buffer, consumername: string | Buffer, callback?: Callback): Result; @@ -2593,6 +2869,7 @@ interface RedisCommander { * Set a consumer group to an arbitrary last delivered ID value. * - _group_: stream * - _complexity_: O(1) + * - _since_: 5.0.0 */ xgroup(subcommand: 'SETID', key: RedisKey, groupname: string | Buffer, id: string | Buffer | number, callback?: Callback): Result; xgroup(subcommand: 'SETID', key: RedisKey, groupname: string | Buffer, newId: '$', callback?: Callback): Result; @@ -2601,6 +2878,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: stream * - _complexity_: O(1) + * - _since_: 5.0.0 */ xgroup(subcommand: 'HELP', callback?: Callback): Result; @@ -2608,6 +2886,7 @@ interface RedisCommander { * List the consumer groups of a stream * - _group_: stream * - _complexity_: O(1) + * - _since_: 5.0.0 */ xinfo(subcommand: 'GROUPS', key: RedisKey, callback?: Callback): Result; @@ -2615,6 +2894,7 @@ interface RedisCommander { * List the consumers in a consumer group * - _group_: stream * - _complexity_: O(1) + * - _since_: 5.0.0 */ xinfo(subcommand: 'CONSUMERS', key: RedisKey, groupname: string | Buffer, callback?: Callback): Result; @@ -2622,6 +2902,7 @@ interface RedisCommander { * Get information about a stream * - _group_: stream * - _complexity_: O(1) + * - _since_: 5.0.0 */ xinfo(subcommand: 'STREAM', key: RedisKey, callback?: Callback): Result; xinfo(subcommand: 'STREAM', key: RedisKey, fullToken: 'FULL', callback?: Callback): Result; @@ -2631,6 +2912,7 @@ interface RedisCommander { * Show helpful text about the different subcommands * - _group_: stream * - _complexity_: O(1) + * - _since_: 5.0.0 */ xinfo(subcommand: 'HELP', callback?: Callback): Result; @@ -2638,6 +2920,7 @@ interface RedisCommander { * Return the number of entries in a stream * - _group_: stream * - _complexity_: O(1) + * - _since_: 5.0.0 */ xlen(key: RedisKey, callback?: Callback): Result; @@ -2645,6 +2928,7 @@ interface RedisCommander { * Return information and entries from a stream consumer group pending entries list, that are messages fetched but never acknowledged. * - _group_: stream * - _complexity_: O(N) with N being the number of elements returned, so asking for a small fixed number of entries per call is O(1). O(M), where M is the total number of entries scanned when used with the IDLE filter. When the command returns just the summary and the list of consumers is small, it runs in O(1) time; otherwise, an additional O(N) time for iterating every consumer. + * - _since_: 5.0.0 */ xpending(key: RedisKey, group: string | Buffer, callback?: Callback): Result; xpending(key: RedisKey, group: string | Buffer, start: string | Buffer | number, end: string | Buffer | number, count: number, callback?: Callback): Result; @@ -2656,6 +2940,7 @@ interface RedisCommander { * Return a range of elements in a stream, with IDs matching the specified IDs interval * - _group_: stream * - _complexity_: O(N) with N being the number of elements being returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). + * - _since_: 5.0.0 */ xrange(key: RedisKey, start: string | Buffer | number, end: string | Buffer | number, callback?: Callback<[id: string, fields: string[]][]>): Result<[id: string, fields: string[]][], Context>; xrangeBuffer(key: RedisKey, start: string | Buffer | number, end: string | Buffer | number, callback?: Callback<[id: Buffer, fields: Buffer[]][]>): Result<[id: Buffer, fields: Buffer[]][], Context>; @@ -2666,6 +2951,7 @@ interface RedisCommander { * Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block. * - _group_: stream * - _complexity_: For each stream mentioned: O(N) with N being the number of elements being returned, it means that XREAD-ing with a fixed COUNT is O(1). Note that when the BLOCK option is used, XADD will pay O(M) time in order to serve the M clients blocked on the stream getting new data. + * - _since_: 5.0.0 */ xread(...args: [streamsToken: 'STREAMS', ...args: (RedisValue)[], callback: Callback]): Result; xread(...args: [streamsToken: 'STREAMS', ...args: (RedisValue)[]]): Result; @@ -2680,6 +2966,7 @@ interface RedisCommander { * Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block. * - _group_: stream * - _complexity_: For each stream mentioned: O(M) with M being the number of elements returned. If M is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). On the other side when XREADGROUP blocks, XADD will pay the O(N) time in order to serve the N clients blocked on the stream getting new data. + * - _since_: 5.0.0 */ xreadgroup(...args: [groupConsumerToken: 'GROUP', group: string | Buffer, consumer: string | Buffer, streamsToken: 'STREAMS', ...args: (RedisValue)[], callback: Callback]): Result; xreadgroup(...args: [groupConsumerToken: 'GROUP', group: string | Buffer, consumer: string | Buffer, streamsToken: 'STREAMS', ...args: (RedisValue)[]]): Result; @@ -2702,6 +2989,7 @@ interface RedisCommander { * Return a range of elements in a stream, with IDs matching the specified IDs interval, in reverse order (from greater to smaller IDs) compared to XRANGE * - _group_: stream * - _complexity_: O(N) with N being the number of elements returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). + * - _since_: 5.0.0 */ xrevrange(key: RedisKey, end: string | Buffer | number, start: string | Buffer | number, callback?: Callback<[id: string, fields: string[]][]>): Result<[id: string, fields: string[]][], Context>; xrevrangeBuffer(key: RedisKey, end: string | Buffer | number, start: string | Buffer | number, callback?: Callback<[id: Buffer, fields: Buffer[]][]>): Result<[id: Buffer, fields: Buffer[]][], Context>; @@ -2712,6 +3000,7 @@ interface RedisCommander { * An internal command for replicating stream values * - _group_: stream * - _complexity_: O(1) + * - _since_: 5.0.0 */ xsetid(key: RedisKey, lastId: string | Buffer | number, callback?: Callback): Result; @@ -2719,6 +3008,7 @@ interface RedisCommander { * Trims the stream to (approximately if '~' is passed) a certain size * - _group_: stream * - _complexity_: O(N), with N being the number of evicted entries. Constant times are very small however, since entries are organized in macro nodes containing multiple entries that can be released with a single deallocation. + * - _since_: 5.0.0 */ xtrim(key: RedisKey, maxlen: 'MAXLEN', threshold: string | Buffer | number, callback?: Callback): Result; xtrim(key: RedisKey, maxlen: 'MAXLEN', threshold: string | Buffer | number, countToken: 'LIMIT', count: number, callback?: Callback): Result; @@ -2737,6 +3027,7 @@ interface RedisCommander { * Add one or more members to a sorted set, or update its score if it already exists * - _group_: sorted-set * - _complexity_: O(log(N)) for each item added, where N is the number of elements in the sorted set. + * - _since_: 1.2.0 */ zadd(...args: [key: RedisKey, ...scoreMembers: (string | Buffer | number)[], callback: Callback]): Result; zadd(...args: [key: RedisKey, ...scoreMembers: (string | Buffer | number)[]]): Result; @@ -2851,6 +3142,7 @@ interface RedisCommander { * Get the number of members in a sorted set * - _group_: sorted-set * - _complexity_: O(1) + * - _since_: 1.2.0 */ zcard(key: RedisKey, callback?: Callback): Result; @@ -2858,6 +3150,7 @@ interface RedisCommander { * Count the members in a sorted set with scores within the given values * - _group_: sorted-set * - _complexity_: O(log(N)) with N being the number of elements in the sorted set. + * - _since_: 2.0.0 */ zcount(key: RedisKey, min: number | string, max: number | string, callback?: Callback): Result; @@ -2865,6 +3158,7 @@ interface RedisCommander { * Subtract multiple sorted sets * - _group_: sorted-set * - _complexity_: O(L + (N-K)log(N)) worst case where L is the total number of elements in all the sets, N is the size of the first set, and K is the size of the result set. + * - _since_: 6.2.0 */ zdiff(...args: [numkeys: number | string, ...keys: (RedisKey)[], callback: Callback]): Result; zdiffBuffer(...args: [numkeys: number | string, ...keys: (RedisKey)[], callback: Callback]): Result; @@ -2887,6 +3181,7 @@ interface RedisCommander { * Subtract multiple sorted sets and store the resulting sorted set in a new key * - _group_: sorted-set * - _complexity_: O(L + (N-K)log(N)) worst case where L is the total number of elements in all the sets, N is the size of the first set, and K is the size of the result set. + * - _since_: 6.2.0 */ zdiffstore(...args: [destination: RedisKey, numkeys: number | string, ...keys: (RedisKey)[], callback: Callback]): Result; zdiffstore(...args: [destination: RedisKey, numkeys: number | string, keys: (RedisKey)[], callback: Callback]): Result; @@ -2897,6 +3192,7 @@ interface RedisCommander { * Increment the score of a member in a sorted set * - _group_: sorted-set * - _complexity_: O(log(N)) where N is the number of elements in the sorted set. + * - _since_: 1.2.0 */ zincrby(key: RedisKey, increment: number | string, member: string | Buffer | number, callback?: Callback): Result; zincrbyBuffer(key: RedisKey, increment: number | string, member: string | Buffer | number, callback?: Callback): Result; @@ -2905,6 +3201,7 @@ interface RedisCommander { * Intersect multiple sorted sets * - _group_: sorted-set * - _complexity_: O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set. + * - _since_: 6.2.0 */ zinter(...args: [numkeys: number | string, ...keys: (RedisKey)[], callback: Callback]): Result; zinterBuffer(...args: [numkeys: number | string, ...keys: (RedisKey)[], callback: Callback]): Result; @@ -3007,6 +3304,7 @@ interface RedisCommander { * Intersect multiple sorted sets and store the resulting sorted set in a new key * - _group_: sorted-set * - _complexity_: O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set. + * - _since_: 2.0.0 */ zinterstore(...args: [destination: RedisKey, numkeys: number | string, ...keys: (RedisKey)[], callback: Callback]): Result; zinterstore(...args: [destination: RedisKey, numkeys: number | string, keys: (RedisKey)[], callback: Callback]): Result; @@ -3037,6 +3335,7 @@ interface RedisCommander { * Count the number of members in a sorted set between a given lexicographical range * - _group_: sorted-set * - _complexity_: O(log(N)) with N being the number of elements in the sorted set. + * - _since_: 2.8.9 */ zlexcount(key: RedisKey, min: string | Buffer | number, max: string | Buffer | number, callback?: Callback): Result; @@ -3044,6 +3343,7 @@ interface RedisCommander { * Get the score associated with the given members in a sorted set * - _group_: sorted-set * - _complexity_: O(N) where N is the number of members being requested. + * - _since_: 6.2.0 */ zmscore(...args: [key: RedisKey, ...members: (string | Buffer | number)[], callback: Callback<(string | null)[]>]): Result<(string | null)[], Context>; zmscoreBuffer(...args: [key: RedisKey, ...members: (string | Buffer | number)[], callback: Callback<(Buffer | null)[]>]): Result<(Buffer | null)[], Context>; @@ -3058,6 +3358,7 @@ interface RedisCommander { * Remove and return members with the highest scores in a sorted set * - _group_: sorted-set * - _complexity_: O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped. + * - _since_: 5.0.0 */ zpopmax(key: RedisKey, callback?: Callback): Result; zpopmaxBuffer(key: RedisKey, callback?: Callback): Result; @@ -3068,6 +3369,7 @@ interface RedisCommander { * Remove and return members with the lowest scores in a sorted set * - _group_: sorted-set * - _complexity_: O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped. + * - _since_: 5.0.0 */ zpopmin(key: RedisKey, callback?: Callback): Result; zpopminBuffer(key: RedisKey, callback?: Callback): Result; @@ -3078,6 +3380,7 @@ interface RedisCommander { * Get one or multiple random elements from a sorted set * - _group_: sorted-set * - _complexity_: O(N) where N is the number of elements returned + * - _since_: 6.2.0 */ zrandmember(key: RedisKey, callback?: Callback): Result; zrandmemberBuffer(key: RedisKey, callback?: Callback): Result; @@ -3090,6 +3393,7 @@ interface RedisCommander { * Return a range of members in a sorted set * - _group_: sorted-set * - _complexity_: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned. + * - _since_: 1.2.0 */ zrange(key: RedisKey, min: string | Buffer | number, max: string | Buffer | number, callback?: Callback): Result; zrangeBuffer(key: RedisKey, min: string | Buffer | number, max: string | Buffer | number, callback?: Callback): Result; @@ -3144,6 +3448,7 @@ interface RedisCommander { * Return a range of members in a sorted set, by lexicographical range * - _group_: sorted-set * - _complexity_: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). + * - _since_: 2.8.9 */ zrangebylex(key: RedisKey, min: string | Buffer | number, max: string | Buffer | number, callback?: Callback): Result; zrangebylexBuffer(key: RedisKey, min: string | Buffer | number, max: string | Buffer | number, callback?: Callback): Result; @@ -3154,6 +3459,7 @@ interface RedisCommander { * Return a range of members in a sorted set, by score * - _group_: sorted-set * - _complexity_: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). + * - _since_: 1.0.5 */ zrangebyscore(key: RedisKey, min: number | string, max: number | string, callback?: Callback): Result; zrangebyscoreBuffer(key: RedisKey, min: number | string, max: number | string, callback?: Callback): Result; @@ -3168,6 +3474,7 @@ interface RedisCommander { * Store a range of members from sorted set into another key * - _group_: sorted-set * - _complexity_: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements stored into the destination key. + * - _since_: 6.2.0 */ zrangestore(dst: RedisKey, src: RedisKey, min: string | Buffer | number, max: string | Buffer | number, callback?: Callback): Result; zrangestore(dst: RedisKey, src: RedisKey, min: string | Buffer | number, max: string | Buffer | number, offsetCountToken: 'LIMIT', offset: number | string, count: number, callback?: Callback): Result; @@ -3186,6 +3493,7 @@ interface RedisCommander { * Determine the index of a member in a sorted set * - _group_: sorted-set * - _complexity_: O(log(N)) + * - _since_: 2.0.0 */ zrank(key: RedisKey, member: string | Buffer | number, callback?: Callback): Result; @@ -3193,6 +3501,7 @@ interface RedisCommander { * Remove one or more members from a sorted set * - _group_: sorted-set * - _complexity_: O(M*log(N)) with N being the number of elements in the sorted set and M the number of elements to be removed. + * - _since_: 1.2.0 */ zrem(...args: [key: RedisKey, ...members: (string | Buffer | number)[], callback: Callback]): Result; zrem(...args: [key: RedisKey, members: (string | Buffer | number)[], callback: Callback]): Result; @@ -3203,6 +3512,7 @@ interface RedisCommander { * Remove all members in a sorted set between the given lexicographical range * - _group_: sorted-set * - _complexity_: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation. + * - _since_: 2.8.9 */ zremrangebylex(key: RedisKey, min: string | Buffer | number, max: string | Buffer | number, callback?: Callback): Result; @@ -3210,6 +3520,7 @@ interface RedisCommander { * Remove all members in a sorted set within the given indexes * - _group_: sorted-set * - _complexity_: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation. + * - _since_: 2.0.0 */ zremrangebyrank(key: RedisKey, start: number, stop: number, callback?: Callback): Result; @@ -3217,6 +3528,7 @@ interface RedisCommander { * Remove all members in a sorted set within the given scores * - _group_: sorted-set * - _complexity_: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation. + * - _since_: 1.2.0 */ zremrangebyscore(key: RedisKey, min: number | string, max: number | string, callback?: Callback): Result; @@ -3224,6 +3536,7 @@ interface RedisCommander { * Return a range of members in a sorted set, by index, with scores ordered from high to low * - _group_: sorted-set * - _complexity_: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned. + * - _since_: 1.2.0 */ zrevrange(key: RedisKey, start: number, stop: number, callback?: Callback): Result; zrevrangeBuffer(key: RedisKey, start: number, stop: number, callback?: Callback): Result; @@ -3234,6 +3547,7 @@ interface RedisCommander { * Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings. * - _group_: sorted-set * - _complexity_: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). + * - _since_: 2.8.9 */ zrevrangebylex(key: RedisKey, max: string | Buffer | number, min: string | Buffer | number, callback?: Callback): Result; zrevrangebylexBuffer(key: RedisKey, max: string | Buffer | number, min: string | Buffer | number, callback?: Callback): Result; @@ -3244,6 +3558,7 @@ interface RedisCommander { * Return a range of members in a sorted set, by score, with scores ordered from high to low * - _group_: sorted-set * - _complexity_: O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). + * - _since_: 2.2.0 */ zrevrangebyscore(key: RedisKey, max: number | string, min: number | string, callback?: Callback): Result; zrevrangebyscoreBuffer(key: RedisKey, max: number | string, min: number | string, callback?: Callback): Result; @@ -3258,6 +3573,7 @@ interface RedisCommander { * Determine the index of a member in a sorted set, with scores ordered from high to low * - _group_: sorted-set * - _complexity_: O(log(N)) + * - _since_: 2.0.0 */ zrevrank(key: RedisKey, member: string | Buffer | number, callback?: Callback): Result; @@ -3265,6 +3581,7 @@ interface RedisCommander { * Incrementally iterate sorted sets elements and associated scores * - _group_: sorted-set * - _complexity_: O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.. + * - _since_: 2.8.0 */ zscan(key: RedisKey, cursor: number | string, callback?: Callback<[cursor: string, elements: string[]]>): Result<[cursor: string, elements: string[]], Context>; zscanBuffer(key: RedisKey, cursor: number | string, callback?: Callback<[cursor: Buffer, elements: Buffer[]]>): Result<[cursor: Buffer, elements: Buffer[]], Context>; @@ -3279,6 +3596,7 @@ interface RedisCommander { * Get the score associated with the given member in a sorted set * - _group_: sorted-set * - _complexity_: O(1) + * - _since_: 1.2.0 */ zscore(key: RedisKey, member: string | Buffer | number, callback?: Callback): Result; zscoreBuffer(key: RedisKey, member: string | Buffer | number, callback?: Callback): Result; @@ -3287,6 +3605,7 @@ interface RedisCommander { * Add multiple sorted sets * - _group_: sorted-set * - _complexity_: O(N)+O(M*log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set. + * - _since_: 6.2.0 */ zunion(...args: [numkeys: number | string, ...keys: (RedisKey)[], callback: Callback]): Result; zunionBuffer(...args: [numkeys: number | string, ...keys: (RedisKey)[], callback: Callback]): Result; @@ -3389,6 +3708,7 @@ interface RedisCommander { * Add multiple sorted sets and store the resulting sorted set in a new key * - _group_: sorted-set * - _complexity_: O(N)+O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set. + * - _since_: 2.0.0 */ zunionstore(...args: [destination: RedisKey, numkeys: number | string, ...keys: (RedisKey)[], callback: Callback]): Result; zunionstore(...args: [destination: RedisKey, numkeys: number | string, keys: (RedisKey)[], callback: Callback]): Result;