Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
1816 lines (1816 sloc) 51.6 KB
APPEND: [
summary: "Append a value to a key"
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
group: 'string
parameters: [
key [string! binary!] "key!"
value [string!]
]
flags: [write may-allocate]
]
AUTH: [
summary: "Authenticate to the server"
since: 1.0.0
group: 'connection
parameters: [
password [string!]
]
flags: [read-only not-scriptable loading-okay stale-data-okay fast-command]
]
BGREWRITEAOF: [
summary: "Asynchronously rewrite the append-only file"
since: 1.0.0
group: 'server
parameters: []
flags: [read-only admin]
]
BGSAVE: [
summary: "Asynchronously save the dataset to disk"
since: 1.0.0
group: 'server
parameters: []
flags: [read-only admin]
]
BITCOUNT: [
summary: "Count set bits in a string"
complexity: "O(N)"
since: 2.6.0
group: 'string
parameters: [
key [string! binary!] "key!"
/range start [integer!] end [integer!]
]
flags: [read-only]
]
BITOP: [
summary: "Perform bitwise operations between strings"
complexity: "O(N)"
since: 2.6.0
group: 'string
parameters: [
operation [string!]
destkey [string! binary!] "key!"
key [string! binary! block!] "key!"
]
flags: [write may-allocate]
]
BITPOS: [
summary: "Find first bit set or clear in a string"
complexity: "O(N)"
since: 2.8.7
group: 'string
parameters: [
key [string! binary!] "key!"
bit [integer!]
/start start-value [integer!]
/end end-value [integer!]
]
flags: [read-only]
]
BLPOP: [
summary: {Remove and get the first element in a list or block until one is available}
complexity: "O(1)"
since: 2.0.0
group: 'list
parameters: [
key [string! binary! block!] "key!"
timeout [integer!]
]
flags: [write not-scriptable]
]
BRPOP: [
summary: {Remove and get the last element in a list or block until one is available}
complexity: "O(1)"
since: 2.0.0
group: 'list
parameters: [
key [string! binary! block!] "key!"
timeout [integer!]
]
flags: [write not-scriptable]
]
BRPOPLPUSH: [
summary: {Pop a value from a list push it to another list and return it; or block until one is available}
complexity: "O(1)"
since: 2.2.0
group: 'list
parameters: [
source [string! binary!] "key!"
destination [string! binary!] "key!"
timeout [integer!]
]
flags: [write may-allocate not-scriptable]
]
CLIENT-GETNAME: [
summary: "Get the current connection name"
complexity: "O(1)"
since: 2.6.9
group: 'server
parameters: []
flags: [read-only admin]
]
CLIENT-KILL: [
summary: "Kill the connection of a client"
complexity: "O(N) where N is the number of client connections"
since: 2.4.0
group: 'server
parameters: [
/ip+port ip+port-value [string!]
/id client-id [integer!]
/type type-value [word!] "enum with choices: 'normal 'slave 'pubsub"
/addr ip+port [string!]
/skipme yes-no [string!]
]
flags: [read-only admin]
]
CLIENT-LIST: [
summary: "Get the list of client connections"
complexity: "O(N) where N is the number of client connections"
since: 2.4.0
group: 'server
parameters: []
flags: [read-only admin]
]
CLIENT-PAUSE: [
summary: {Stop processing commands from clients for some time}
complexity: "O(1)"
since: 2.9.50
group: 'server
parameters: [
timeout [integer!]
]
flags: [read-only admin]
]
CLIENT-SETNAME: [
summary: "Set the current connection name"
complexity: "O(1)"
since: 2.6.9
group: 'server
parameters: [
connection-name [string!]
]
flags: [read-only admin]
]
CLUSTER-SLOTS: [
summary: "Get array of Cluster slot to node mappings"
complexity: "O(N) where N is the total number of Cluster nodes"
since: 3.0.0
group: 'server
parameters: []
]
COMMAND: [
summary: "Get array of Redis command details"
complexity: "O(N) where N is the total number of Redis commands"
since: 2.8.13
group: 'server
parameters: []
]
COMMAND-COUNT: [
summary: "Get total number of Redis commands"
complexity: "O(1)"
since: 2.8.13
group: 'server
parameters: []
flags: [read-only loading-okay stale-data-okay]
]
COMMAND-GETKEYS: [
summary: "Extract keys given a full Redis command"
complexity: {O(N) where N is the number of arugments to the command}
since: 2.8.13
group: 'server
parameters: []
flags: [read-only loading-okay stale-data-okay]
]
COMMAND-INFO: [
summary: "Get array of specific Redis command details"
complexity: "O(N) when N is number of commands to look up"
since: 2.8.13
group: 'server
parameters: [
command-name [string! block!]
]
flags: [read-only loading-okay stale-data-okay]
]
CONFIG-GET: [
summary: "Get the value of a configuration parameter"
since: 2.0.0
group: 'server
parameters: [
parameter [string!]
]
flags: [read-only admin stale-data-okay]
]
CONFIG-RESETSTAT: [
summary: "Reset the stats returned by INFO"
complexity: "O(1)"
since: 2.0.0
group: 'server
parameters: []
flags: [read-only admin stale-data-okay]
]
CONFIG-REWRITE: [
summary: {Rewrite the configuration file with the in memory configuration}
since: 2.8.0
group: 'server
parameters: []
flags: [read-only admin stale-data-okay]
]
CONFIG-SET: [
summary: "Set a configuration parameter to the given value"
since: 2.0.0
group: 'server
parameters: [
parameter [string!]
value [string!]
]
flags: [read-only admin stale-data-okay]
]
DBSIZE: [
summary: "Return the number of keys in the selected database"
since: 1.0.0
group: 'server
parameters: []
flags: [read-only fast-command]
]
DEBUG-OBJECT: [
summary: "Get debugging information about a key"
since: 1.0.0
group: 'server
parameters: [
key [string! binary!] "key!"
]
flags: [admin not-scriptable]
]
DEBUG-SEGFAULT: [
summary: "Make the server crash"
since: 1.0.0
group: 'server
parameters: []
flags: [admin not-scriptable]
]
DECR: [
summary: "Decrement the integer value of a key by one"
complexity: "O(1)"
since: 1.0.0
group: 'string
parameters: [
key [string! binary!] "key!"
]
flags: [write may-allocate fast-command]
]
DECRBY: [
summary: {Decrement the integer value of a key by the given number}
complexity: "O(1)"
since: 1.0.0
group: 'string
parameters: [
key [string! binary!] "key!"
decrement [integer!]
]
flags: [write may-allocate fast-command]
]
DEL: [
summary: "Delete a key"
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
group: 'generic
parameters: [
key [string! binary! block!] "key!"
]
flags: [write]
]
DISCARD: [
summary: "Discard all commands issued after MULTI"
since: 2.0.0
group: 'transactions
parameters: []
flags: [read-only not-scriptable fast-command]
]
DUMP: [
summary: {Return a serialized version of the value stored at the specified key.}
complexity: {O(1) to access the key and additional O(N*M) to serialized 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
group: 'generic
parameters: [
key [string! binary!] "key!"
]
flags: [read-only admin]
]
ECHO: [
summary: "Echo the given string"
since: 1.0.0
group: 'connection
parameters: [
message [string!]
]
flags: [read-only fast-command]
]
EVAL: [
summary: "Execute a Lua script server side"
complexity: "Depends on the script that is executed."
since: 2.6.0
group: 'scripting
parameters: [
script [string!]
numkeys [integer!]
key [string! binary! block!] "key!"
arg [string! block!]
]
flags: [not-scriptable]
]
EVALSHA: [
summary: "Execute a Lua script server side"
complexity: "Depends on the script that is executed."
since: 2.6.0
group: 'scripting
parameters: [
sha1 [string!]
numkeys [integer!]
key [string! binary! block!] "key!"
arg [string! block!]
]
flags: [not-scriptable]
]
EXEC: [
summary: "Execute all commands issued after MULTI"
since: 1.2.0
group: 'transactions
parameters: []
flags: [not-scriptable no-monitor-propagate]
]
EXISTS: [
summary: "Determine if a key exists"
complexity: "O(1)"
since: 1.0.0
group: 'generic
parameters: [
key [string! binary!] "key!"
]
flags: [read-only fast-command]
]
EXPIRE: [
summary: "Set a key's time to live in seconds"
complexity: "O(1)"
since: 1.0.0
group: 'generic
parameters: [
key [string! binary!] "key!"
seconds [integer!]
]
flags: [write fast-command]
]
EXPIREAT: [
summary: "Set the expiration for a key as a UNIX timestamp"
complexity: "O(1)"
since: 1.2.0
group: 'generic
parameters: [
key [string! binary!] "key!"
timestamp [time!]
]
flags: [write fast-command]
]
FLUSHALL: [
summary: "Remove all keys from all databases"
since: 1.0.0
group: 'server
parameters: []
flags: [write]
]
FLUSHDB: [
summary: "Remove all keys from the current database"
since: 1.0.0
group: 'server
parameters: []
flags: [write]
]
GET: [
summary: "Get the value of a key"
complexity: "O(1)"
since: 1.0.0
group: 'string
parameters: [
key [string! binary!] "key!"
]
flags: [read-only fast-command]
]
GETBIT: [
summary: {Returns the bit value at offset in the string value stored at key}
complexity: "O(1)"
since: 2.2.0
group: 'string
parameters: [
key [string! binary!] "key!"
offset [integer!]
]
flags: [read-only fast-command]
]
GETRANGE: [
summary: "Get a substring of the string stored at a key"
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
group: 'string
parameters: [
key [string! binary!] "key!"
start [integer!]
end [integer!]
]
flags: [read-only]
]
GETSET: [
summary: {Set the string value of a key and return its old value}
complexity: "O(1)"
since: 1.0.0
group: 'string
parameters: [
key [string! binary!] "key!"
value [string!]
]
flags: [write may-allocate]
]
HDEL: [
summary: "Delete one or more hash fields"
complexity: {O(N) where N is the number of fields to be removed.}
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
field [string! block!]
]
flags: [write fast-command]
]
HEXISTS: [
summary: "Determine if a hash field exists"
complexity: "O(1)"
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
field [string!]
]
flags: [read-only fast-command]
]
HGET: [
summary: "Get the value of a hash field"
complexity: "O(1)"
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
field [string!]
]
flags: [read-only fast-command]
]
HGETALL: [
summary: "Get all the fields and values in a hash"
complexity: "O(N) where N is the size of the hash."
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
]
flags: [read-only]
]
HINCRBY: [
summary: {Increment the integer value of a hash field by the given number}
complexity: "O(1)"
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
field [string!]
increment [integer!]
]
flags: [write may-allocate fast-command]
]
HINCRBYFLOAT: [
summary: {Increment the float value of a hash field by the given amount}
complexity: "O(1)"
since: 2.6.0
group: 'hash
parameters: [
key [string! binary!] "key!"
field [string!]
increment [decimal!]
]
flags: [write may-allocate fast-command]
]
HKEYS: [
summary: "Get all the fields in a hash"
complexity: "O(N) where N is the size of the hash."
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
]
flags: [read-only sort-output]
]
HLEN: [
summary: "Get the number of fields in a hash"
complexity: "O(1)"
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
]
flags: [read-only fast-command]
]
HMGET: [
summary: "Get the values of all the given hash fields"
complexity: {O(N) where N is the number of fields being requested.}
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
field [string! block!]
]
flags: [read-only]
]
HMSET: [
summary: "Set multiple hash fields to multiple values"
complexity: "O(N) where N is the number of fields being set."
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
field-value-pairs [block!]
]
flags: [write may-allocate]
]
HSCAN: [
summary: {Incrementally iterate hash fields and associated values}
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
group: 'hash
parameters: [
key [string! binary!] "key!"
cursor [integer!]
/match pattern [string!] "pattern"
/count count [integer!]
]
flags: [read-only non-deterministic]
]
HSET: [
summary: "Set the string value of a hash field"
complexity: "O(1)"
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
field [string!]
value [string!]
]
flags: [write may-allocate fast-command]
]
HSETNX: [
summary: {Set the value of a hash field only if the field does not exist}
complexity: "O(1)"
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
field [string!]
value [string!]
]
flags: [write may-allocate fast-command]
]
HVALS: [
summary: "Get all the values in a hash"
complexity: "O(N) where N is the size of the hash."
since: 2.0.0
group: 'hash
parameters: [
key [string! binary!] "key!"
]
flags: [read-only sort-output]
]
INCR: [
summary: "Increment the integer value of a key by one"
complexity: "O(1)"
since: 1.0.0
group: 'string
parameters: [
key [string! binary!] "key!"
]
flags: [write may-allocate fast-command]
]
INCRBY: [
summary: {Increment the integer value of a key by the given amount}
complexity: "O(1)"
since: 1.0.0
group: 'string
parameters: [
key [string! binary!] "key!"
increment [integer!]
]
flags: [write may-allocate fast-command]
]
INCRBYFLOAT: [
summary: {Increment the float value of a key by the given amount}
complexity: "O(1)"
since: 2.6.0
group: 'string
parameters: [
key [string! binary!] "key!"
increment [decimal!]
]
flags: [write may-allocate fast-command]
]
INFO: [
summary: "Get information and statistics about the server"
since: 1.0.0
group: 'server
parameters: [
/section section-value [string!]
]
flags: [read-only loading-okay stale-data-okay]
]
KEYS: [
summary: "Find all keys matching the given pattern"
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
group: 'generic
parameters: [
pattern [string!] "pattern"
]
flags: [read-only sort-output]
]
LASTSAVE: [
summary: {Get the UNIX time stamp of the last successful save to disk}
since: 1.0.0
group: 'server
parameters: []
flags: [read-only non-deterministic fast-command]
]
LATENCY: [
summary: "Internal, undocumented."
complexity: "Undocumented, unknown."
since: 3.0.0
group: 'internal
parameters: []
flags: [read-only admin not-scriptable loading-okay stale-data-okay]
]
LINDEX: [
summary: "Get an element from a list by its index"
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
group: 'list
parameters: [
key [string! binary!] "key!"
index [integer!]
]
flags: [read-only]
]
LINSERT: [
summary: {Insert an element before or after another element in a 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
group: 'list
parameters: [
key [string! binary!] "key!"
where [word!] "enum with choices: 'BEFORE 'AFTER"
pivot [string!]
value [string!]
]
flags: [write may-allocate]
]
LLEN: [
summary: "Get the length of a list"
complexity: "O(1)"
since: 1.0.0
group: 'list
parameters: [
key [string! binary!] "key!"
]
flags: [read-only fast-command]
]
LPOP: [
summary: "Remove and get the first element in a list"
complexity: "O(1)"
since: 1.0.0
group: 'list
parameters: [
key [string! binary!] "key!"
]
flags: [write fast-command]
]
LPUSH: [
summary: "Prepend one or multiple values to a list"
complexity: "O(1)"
since: 1.0.0
group: 'list
parameters: [
key [string! binary!] "key!"
value [string! block!]
]
flags: [write may-allocate fast-command]
]
LPUSHX: [
summary: "Prepend a value to a list only if the list exists"
complexity: "O(1)"
since: 2.2.0
group: 'list
parameters: [
key [string! binary!] "key!"
value [string!]
]
flags: [write may-allocate fast-command]
]
LRANGE: [
summary: "Get a range of elements from a 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
group: 'list
parameters: [
key [string! binary!] "key!"
start [integer!]
stop [integer!]
]
flags: [read-only]
]
LREM: [
summary: "Remove elements from a list"
complexity: "O(N) where N is the length of the list."
since: 1.0.0
group: 'list
parameters: [
key [string! binary!] "key!"
count [integer!]
value [string!]
]
flags: [write]
]
LSET: [
summary: "Set the value of an element in a list by its index"
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
group: 'list
parameters: [
key [string! binary!] "key!"
index [integer!]
value [string!]
]
flags: [write may-allocate]
]
LTRIM: [
summary: "Trim a list to the specified range"
complexity: {O(N) where N is the number of elements to be removed by the operation.}
since: 1.0.0
group: 'list
parameters: [
key [string! binary!] "key!"
start [integer!]
stop [integer!]
]
flags: [write]
]
MGET: [
summary: "Get the values of all the given keys"
complexity: "O(N) where N is the number of keys to retrieve."
since: 1.0.0
group: 'string
parameters: [
key [string! binary! block!] "key!"
]
flags: [read-only]
]
MIGRATE: [
summary: {Atomically transfer a key from a Redis instance to another one.}
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
group: 'generic
parameters: [
host [string!]
port [string!]
key [string! binary!] "key!"
destination-db [integer!]
timeout [integer!] /copy /replace
]
flags: [write admin]
]
MONITOR: [
summary: {Listen for all requests received by the server in real time}
since: 1.0.0
group: 'server
parameters: []
flags: [read-only admin not-scriptable]
]
MOVE: [
summary: "Move a key to another database"
complexity: "O(1)"
since: 1.0.0
group: 'generic
parameters: [
key [string! binary!] "key!"
db [integer!]
]
flags: [write fast-command]
]
MSET: [
summary: "Set multiple keys to multiple values"
complexity: "O(N) where N is the number of keys to set."
since: 1.0.1
group: 'string
parameters: [
key-value-pairs [block!]
]
flags: [write may-allocate]
]
MSETNX: [
summary: {Set multiple keys to multiple values only if none of the keys exist}
complexity: "O(N) where N is the number of keys to set."
since: 1.0.1
group: 'string
parameters: [
key-value-pairs [block!]
]
flags: [write may-allocate]
]
MULTI: [
summary: "Mark the start of a transaction block"
since: 1.2.0
group: 'transactions
parameters: []
flags: [read-only not-scriptable fast-command]
]
OBJECT: [
summary: "Inspect the internals of Redis objects"
complexity: {O(1) for all the currently implemented subcommands.}
since: 2.2.3
group: 'generic
parameters: [
subcommand [string!]
/arguments arguments-value [string! block!]
]
flags: [read-only]
]
PERSIST: [
summary: "Remove the expiration from a key"
complexity: "O(1)"
since: 2.2.0
group: 'generic
parameters: [
key [string! binary!] "key!"
]
flags: [write fast-command]
]
PEXPIRE: [
summary: "Set a key's time to live in milliseconds"
complexity: "O(1)"
since: 2.6.0
group: 'generic
parameters: [
key [string! binary!] "key!"
milliseconds [integer!]
]
flags: [write fast-command]
]
PEXPIREAT: [
summary: {Set the expiration for a key as a UNIX timestamp specified in milliseconds}
complexity: "O(1)"
since: 2.6.0
group: 'generic
parameters: [
key [string! binary!] "key!"
milliseconds-timestamp [time!]
]
flags: [write fast-command]
]
PFADD: [
summary: {Adds the specified elements to the specified HyperLogLog.}
complexity: "O(1) to add every element."
since: 2.8.9
group: 'hyperloglog
parameters: [
key [string! binary!] "key!"
element [string! block!]
]
flags: [write may-allocate fast-command]
]
PFCOUNT: [
summary: {Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).}
complexity: {O(1) with every small average constant times 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
group: 'hyperloglog
parameters: [
key [string! binary! block!] "key!"
]
flags: [write]
]
PFDEBUG: [
summary: "Internal, undocumented."
complexity: "Undocumented, unknown."
since: 3.0.0
group: 'internal
parameters: []
flags: [write]
]
PFMERGE: [
summary: "Merge N different HyperLogLogs into a single one."
complexity: {O(N) to merge N HyperLogLogs but with high constant times.}
since: 2.8.9
group: 'hyperloglog
parameters: [
destkey [string! binary!] "key!"
sourcekey [string! binary! block!] "key!"
]
flags: [write may-allocate]
]
PFSELFTEST: [
summary: "Internal, undocumented."
complexity: "Undocumented, unknown."
since: 3.0.0
group: 'internal
parameters: []
flags: [read-only]
]
PING: [
summary: "Ping the server"
since: 1.0.0
group: 'connection
parameters: []
flags: [read-only stale-data-okay fast-command]
]
PSETEX: [
summary: {Set the value and expiration in milliseconds of a key}
complexity: "O(1)"
since: 2.6.0
group: 'string
parameters: [
key [string! binary!] "key!"
milliseconds [integer!]
value [string!]
]
flags: [write may-allocate]
]
PSUBSCRIBE: [
summary: {Listen for messages published to channels matching the given patterns}
complexity: {O(N) where N is the number of patterns the client is already subscribed to.}
since: 2.0.0
group: 'pubsub
parameters: [
pattern [string! block!] "pattern"
]
flags: [read-only pub-sub not-scriptable loading-okay stale-data-okay]
]
PSYNC: [
summary: "Internal command used for replication"
complexity: "Undocumented, unknown."
since: 3.0.0
group: 'internal
parameters: []
flags: [read-only admin not-scriptable]
]
PTTL: [
summary: "Get the time to live for a key in milliseconds"
complexity: "O(1)"
since: 2.6.0
group: 'generic
parameters: [
key [string! binary!] "key!"
]
flags: [read-only fast-command]
]
PUBLISH: [
summary: "Post a message to a channel"
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
group: 'pubsub
parameters: [
channel [string!]
message [string!]
]
flags: [read-only pub-sub loading-okay stale-data-okay fast-command]
]
PUBSUB: [
summary: "Inspect the state of the Pub/Sub subsystem"
complexity: {O(N) for the CHANNELS subcommand where N is the number of active channels and assuming constant time pattern matching (relatively short channels and patterns). O(N) for the NUMSUB subcommand where N is the number of requested channels. O(1) for the NUMPAT subcommand.}
since: 2.8.0
group: 'pubsub
parameters: [
subcommand [string!]
/argument argument-value [string! block!]
]
flags: [read-only pub-sub non-deterministic loading-okay stale-data-okay]
]
PUNSUBSCRIBE: [
summary: {Stop listening for messages posted to channels matching the given patterns}
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
group: 'pubsub
parameters: [
/pattern pattern-value [string! block!] "pattern"
]
flags: [read-only pub-sub not-scriptable loading-okay stale-data-okay]
]
QUIT: [
summary: "Close the connection"
since: 1.0.0
group: 'connection
parameters: []
]
RANDOMKEY: [
summary: "Return a random key from the keyspace"
complexity: "O(1)"
since: 1.0.0
group: 'generic
parameters: []
flags: [read-only non-deterministic]
]
READONLY: [
summary: "Internal, undocumented."
complexity: "Undocumented, unknown."
since: 3.0.0
group: 'internal
parameters: []
flags: [read-only fast-command]
]
READWRITE: [
summary: "Internal, undocumented."
complexity: "Undocumented, unknown."
since: 3.0.0
group: 'internal
parameters: []
flags: [read-only fast-command]
]
RENAME: [
summary: "Rename a key"
complexity: "O(1)"
since: 1.0.0
group: 'generic
parameters: [
key [string! binary!] "key!"
newkey [string! binary!] "key!"
]
flags: [write]
]
RENAMENX: [
summary: "Rename a key only if the new key does not exist"
complexity: "O(1)"
since: 1.0.0
group: 'generic
parameters: [
key [string! binary!] "key!"
newkey [string! binary!] "key!"
]
flags: [write fast-command]
]
REPLCONF: [
summary: "Internal replication functionality, undocumented"
complexity: "Undocumented, unknown."
since: 2.2.0
group: 'internal
parameters: [
/listening-port port [integer!]
]
flags: [read-only admin not-scriptable loading-okay stale-data-okay]
]
RESTORE: [
summary: {Create a key using the provided serialized value previously obtained using DUMP.}
complexity: {O(1) to create the new key and additional O(N*M) to recostruct 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
group: 'generic
parameters: [
key [string! binary!] "key!"
ttl [integer!]
serialized-value [string!]
]
flags: [write may-allocate admin]
]
RESTORE-ASKING: [
summary: {Asking variant of create a key using the provided serialized value, previously obtained using DUMP.}
complexity: {O(1) to create the new key and additional O(N*M) to recostruct 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
group: 'generic
parameters: [
key [string! binary!] "key!"
ttl [integer!]
serialized-value [string!]
]
flags: [write may-allocate admin implicit-asking]
]
ROLE: [
summary: {Return the role of the instance in the context of replication}
since: 2.8.12
group: 'server
parameters: []
flags: [admin not-scriptable loading-okay stale-data-okay]
]
RPOP: [
summary: "Remove and get the last element in a list"
complexity: "O(1)"
since: 1.0.0
group: 'list
parameters: [
key [string! binary!] "key!"
]
flags: [write fast-command]
]
RPOPLPUSH: [
summary: {Remove the last element in a list append it to another list and return it}
complexity: "O(1)"
since: 1.2.0
group: 'list
parameters: [
source [string! binary!] "key!"
destination [string! binary!] "key!"
]
flags: [write may-allocate]
]
RPUSH: [
summary: "Append one or multiple values to a list"
complexity: "O(1)"
since: 1.0.0
group: 'list
parameters: [
key [string! binary!] "key!"
value [string! block!]
]
flags: [write may-allocate fast-command]
]
RPUSHX: [
summary: "Append a value to a list only if the list exists"
complexity: "O(1)"
since: 2.2.0
group: 'list
parameters: [
key [string! binary!] "key!"
value [string!]
]
flags: [write may-allocate fast-command]
]
SADD: [
summary: "Add one or more members to a set"
complexity: "O(N) where N is the number of members to be added."
since: 1.0.0
group: 'set
parameters: [
key [string! binary!] "key!"
member [string! block!]
]
flags: [write may-allocate fast-command]
]
SAVE: [
summary: "Synchronously save the dataset to disk"
since: 1.0.0
group: 'server
parameters: []
flags: [read-only admin not-scriptable]
]
SCAN: [
summary: "Incrementally iterate the keys space"
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
group: 'generic
parameters: [
cursor [integer!]
/match pattern [string!] "pattern"
/count count [integer!]
]
flags: [read-only non-deterministic]
]
SCARD: [
summary: "Get the number of members in a set"
complexity: "O(1)"
since: 1.0.0
group: 'set
parameters: [
key [string! binary!] "key!"
]
flags: [read-only fast-command]
]
SCRIPT-EXISTS: [
summary: "Check existence of scripts in the script cache."
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
group: 'scripting
parameters: [
script [string! block!]
]
flags: [read-only admin not-scriptable]
]
SCRIPT-FLUSH: [
summary: "Remove all the scripts from the script cache."
complexity: "O(N) with N being the number of scripts in cache"
since: 2.6.0
group: 'scripting
parameters: []
flags: [read-only admin not-scriptable]
]
SCRIPT-KILL: [
summary: "Kill the script currently in execution."
complexity: "O(1)"
since: 2.6.0
group: 'scripting
parameters: []
flags: [read-only admin not-scriptable]
]
SCRIPT-LOAD: [
summary: {Load the specified Lua script into the script cache.}
complexity: {O(N) with N being the length in bytes of the script body.}
since: 2.6.0
group: 'scripting
parameters: [
script [string!]
]
flags: [read-only admin not-scriptable]
]
SDIFF: [
summary: "Subtract multiple sets"
complexity: {O(N) where N is the total number of elements in all given sets.}
since: 1.0.0
group: 'set
parameters: [
key [string! binary! block!] "key!"
]
flags: [read-only sort-output]
]
SDIFFSTORE: [
summary: {Subtract multiple sets and store the resulting set in a key}
complexity: {O(N) where N is the total number of elements in all given sets.}
since: 1.0.0
group: 'set
parameters: [
destination [string! binary!] "key!"
key [string! binary! block!] "key!"
]
flags: [write may-allocate]
]
SELECT: [
summary: {Change the selected database for the current connection}
since: 1.0.0
group: 'connection
parameters: [
index [integer!]
]
flags: [read-only loading-okay fast-command]
]
SET: [
summary: "Set the string value of a key"
complexity: "O(1)"
since: 1.0.0
group: 'string
parameters: [
key [string! binary!] "key!"
value [string!]
/ex seconds [integer!]
/px milliseconds [integer!]
/condition condition-value [word!] "enum with choices: 'NX 'XX"
]
flags: [write may-allocate]
]
SETBIT: [
summary: {Sets or clears the bit at offset in the string value stored at key}
complexity: "O(1)"
since: 2.2.0
group: 'string
parameters: [
key [string! binary!] "key!"
offset [integer!]
value [string!]
]
flags: [write may-allocate]
]
SETEX: [
summary: "Set the value and expiration of a key"
complexity: "O(1)"
since: 2.0.0
group: 'string
parameters: [
key [string! binary!] "key!"
seconds [integer!]
value [string!]
]
flags: [write may-allocate]
]
SETNX: [
summary: {Set the value of a key only if the key does not exist}
complexity: "O(1)"
since: 1.0.0
group: 'string
parameters: [
key [string! binary!] "key!"
value [string!]
]
flags: [write may-allocate fast-command]
]
SETRANGE: [
summary: {Overwrite part of a string at key starting at the specified offset}
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
group: 'string
parameters: [
key [string! binary!] "key!"
offset [integer!]
value [string!]
]
flags: [write may-allocate]
]
SHUTDOWN: [
summary: {Synchronously save the dataset to disk and then shut down the server}
since: 1.0.0
group: 'server
parameters: [/nosave /save]
flags: [read-only admin loading-okay stale-data-okay]
]
SINTER: [
summary: "Intersect multiple sets"
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
group: 'set
parameters: [
key [string! binary! block!] "key!"
]
flags: [read-only sort-output]
]
SINTERSTORE: [
summary: {Intersect multiple sets and store the resulting set in a key}
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
group: 'set
parameters: [
destination [string! binary!] "key!"
key [string! binary! block!] "key!"
]
flags: [write may-allocate]
]
SISMEMBER: [
summary: "Determine if a given value is a member of a set"
complexity: "O(1)"
since: 1.0.0
group: 'set
parameters: [
key [string! binary!] "key!"
member [string!]
]
flags: [read-only fast-command]
]
SLAVEOF: [
summary: {Make the server a slave of another instance or promote it as master}
since: 1.0.0
group: 'server
parameters: [
host [string!]
port [string!]
]
flags: [admin not-scriptable stale-data-okay]
]
SLOWLOG: [
summary: "Manages the Redis slow queries log"
since: 2.2.12
group: 'server
parameters: [
subcommand [string!]
/argument argument-value [string!]
]
flags: [read-only]
]
SMEMBERS: [
summary: "Get all the members in a set"
complexity: "O(N) where N is the set cardinality."
since: 1.0.0
group: 'set
parameters: [
key [string! binary!] "key!"
]
flags: [read-only sort-output]
]
SMOVE: [
summary: "Move a member from one set to another"
complexity: "O(1)"
since: 1.0.0
group: 'set
parameters: [
source [string! binary!] "key!"
destination [string! binary!] "key!"
member [string!]
]
flags: [write fast-command]
]
SORT: [
summary: "Sort the elements in a list set or sorted set"
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 currently O(N) as there is a copy step that will be avoided in next releases.}
since: 1.0.0
group: 'generic
parameters: [
key [string! binary!] "key!"
/by pattern [string!] "pattern"
/limit offset [integer!] count [integer!]
/get pattern [string! block!]
/order order-value [word!] "enum with choices: 'ASC 'DESC" /alpha
/store destination [string! binary!] "key!"
]
flags: [write may-allocate]
]
SPOP: [
summary: "Remove and return a random member from a set"
complexity: "O(1)"
since: 1.0.0
group: 'set
parameters: [
key [string! binary!] "key!"
]
flags: [write not-scriptable non-deterministic fast-command]
]
SRANDMEMBER: [
summary: "Get one or multiple random members from a 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
group: 'set
parameters: [
key [string! binary!] "key!"
/count count-value [integer!]
]
flags: [read-only non-deterministic]
]
SREM: [
summary: "Remove one or more members from a set"
complexity: {O(N) where N is the number of members to be removed.}
since: 1.0.0
group: 'set
parameters: [
key [string! binary!] "key!"
member [string! block!]
]
flags: [write fast-command]
]
SSCAN: [
summary: "Incrementally iterate Set elements"
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
group: 'set
parameters: [
key [string! binary!] "key!"
cursor [integer!]
/match pattern [string!] "pattern"
/count count [integer!]
]
flags: [read-only non-deterministic]
]
STRLEN: [
summary: "Get the length of the value stored in a key"
complexity: "O(1)"
since: 2.2.0
group: 'string
parameters: [
key [string! binary!] "key!"
]
flags: [read-only fast-command]
]
SUBSCRIBE: [
summary: {Listen for messages published to the given channels}
complexity: {O(N) where N is the number of channels to subscribe to.}
since: 2.0.0
group: 'pubsub
parameters: [
channel [string! block!]
]
flags: [read-only pub-sub not-scriptable loading-okay stale-data-okay]
]
SUNION: [
summary: "Add multiple sets"
complexity: {O(N) where N is the total number of elements in all given sets.}
since: 1.0.0
group: 'set
parameters: [
key [string! binary! block!] "key!"
]
flags: [read-only sort-output]
]
SUNIONSTORE: [
summary: {Add multiple sets and store the resulting set in a key}
complexity: {O(N) where N is the total number of elements in all given sets.}
since: 1.0.0
group: 'set
parameters: [
destination [string! binary!] "key!"
key [string! binary! block!] "key!"
]
flags: [write may-allocate]
]
SYNC: [
summary: "Internal command used for replication"
since: 1.0.0
group: 'server
parameters: []
flags: [read-only admin not-scriptable]
]
TIME: [
summary: "Return the current server time"
complexity: "O(1)"
since: 2.6.0
group: 'server
parameters: []
flags: [read-only non-deterministic fast-command]
]
TTL: [
summary: "Get the time to live for a key"
complexity: "O(1)"
since: 1.0.0
group: 'generic
parameters: [
key [string! binary!] "key!"
]
flags: [read-only fast-command]
]
TYPE: [
summary: "Determine the type stored at key"
complexity: "O(1)"
since: 1.0.0
group: 'generic
parameters: [
key [string! binary!] "key!"
]
flags: [read-only fast-command]
]
UNSUBSCRIBE: [
summary: {Stop listening for messages posted to the given channels}
complexity: {O(N) where N is the number of clients already subscribed to a channel.}
since: 2.0.0
group: 'pubsub
parameters: [
/channel channel-value [string! block!]
]
flags: [read-only pub-sub not-scriptable loading-okay stale-data-okay]
]
UNWATCH: [
summary: "Forget about all watched keys"
complexity: "O(1)"
since: 2.2.0
group: 'transactions
parameters: []
flags: [read-only not-scriptable fast-command]
]
WAIT: [
summary: "Internal, undocumented."
complexity: "Undocumented, unknown."
since: 3.0.0
group: 'internal
parameters: []
flags: [read-only not-scriptable]
]
WATCH: [
summary: {Watch the given keys to determine execution of the MULTI/EXEC block}
complexity: "O(1) for every key."
since: 2.2.0
group: 'transactions
parameters: [
key [string! binary! block!] "key!"
]
flags: [read-only not-scriptable fast-command]
]
ZADD: [
summary: {Add one or more members to a sorted set or update its score if it already exists}
complexity: {O(log(N)) where N is the number of elements in the sorted set.}
since: 1.2.0
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
scores-and-members [block!]
]
flags: [write may-allocate fast-command]
]
ZCARD: [
summary: "Get the number of members in a sorted set"
complexity: "O(1)"
since: 1.2.0
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
]
flags: [read-only fast-command]
]
ZCOUNT: [
summary: {Count the members in a sorted set with scores within the given values}
complexity: {O(log(N)) with N being the number of elements in the sorted set.}
since: 2.0.0
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
min [decimal!]
max [decimal!]
]
flags: [read-only fast-command]
]
ZINCRBY: [
summary: "Increment the score of a member in a sorted set"
complexity: {O(log(N)) where N is the number of elements in the sorted set.}
since: 1.2.0
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
increment [integer!]
member [string!]
]
flags: [write may-allocate fast-command]
]
ZINTERSTORE: [
summary: {Intersect multiple sorted sets and store the resulting sorted set in a new key}
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
group: 'sorted_set
parameters: [
destination [string! binary!] "key!"
numkeys [integer!]
key [string! binary! block!] "key!"
/weights weight [integer! block!]
/aggregate aggregate-value [word!] "enum with choices: 'SUM 'MIN 'MAX"
]
flags: [write may-allocate]
]
ZLEXCOUNT: [
summary: {Count the number of members in a sorted set between a given lexicographical range}
complexity: {O(log(N)) with N being the number of elements in the sorted set.}
since: 2.8.9
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
min [string!]
max [string!]
]
flags: [read-only fast-command]
]
ZRANGE: [
summary: {Return a range of members in a sorted set by index}
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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
start [integer!]
stop [integer!] /withscores
]
flags: [read-only]
]
ZRANGEBYLEX: [
summary: {Return a range of members in a sorted set by lexicographical range}
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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
min [string!]
max [string!]
/limit offset [integer!] count [integer!]
]
flags: [read-only]
]
ZRANGEBYSCORE: [
summary: {Return a range of members in a sorted set by score}
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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
min [decimal!]
max [decimal!] /withscores
/limit offset [integer!] count [integer!]
]
flags: [read-only]
]
ZRANK: [
summary: "Determine the index of a member in a sorted set"
complexity: "O(log(N))"
since: 2.0.0
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
member [string!]
]
flags: [read-only fast-command]
]
ZREM: [
summary: "Remove one or more members from a 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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
member [string! block!]
]
flags: [write fast-command]
]
ZREMRANGEBYLEX: [
summary: {Remove all members in a sorted set between the given lexicographical range}
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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
min [string!]
max [string!]
]
flags: [write]
]
ZREMRANGEBYRANK: [
summary: {Remove all members in a sorted set within the given indexes}
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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
start [integer!]
stop [integer!]
]
flags: [write]
]
ZREMRANGEBYSCORE: [
summary: {Remove all members in a sorted set within the given scores}
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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
min [decimal!]
max [decimal!]
]
flags: [write]
]
ZREVRANGE: [
summary: {Return a range of members in a sorted set by index with scores ordered from high to low}
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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
start [integer!]
stop [integer!] /withscores
]
flags: [read-only]
]
ZREVRANGEBYLEX: [
summary: {Return a range of members in a sorted set, by lexicographical range, with the scores ordered from high to low.}
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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
max [string!]
min [string!]
/limit offset [integer!] count [integer!]
]
flags: [read-only]
]
ZREVRANGEBYSCORE: [
summary: {Return a range of members in a sorted set by score with scores ordered from high to low}
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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
max [decimal!]
min [decimal!] /withscores
/limit offset [integer!] count [integer!]
]
flags: [read-only]
]
ZREVRANK: [
summary: {Determine the index of a member in a sorted set with scores ordered from high to low}
complexity: "O(log(N))"
since: 2.0.0
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
member [string!]
]
flags: [read-only fast-command]
]
ZSCAN: [
summary: {Incrementally iterate sorted sets elements and associated scores}
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
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
cursor [integer!]
/match pattern [string!] "pattern"
/count count [integer!]
]
flags: [read-only non-deterministic]
]
ZSCORE: [
summary: {Get the score associated with the given member in a sorted set}
complexity: "O(1)"
since: 1.2.0
group: 'sorted_set
parameters: [
key [string! binary!] "key!"
member [string!]
]
flags: [read-only fast-command]
]
ZUNIONSTORE: [
summary: {Add multiple sorted sets and store the resulting sorted set in a new key}
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
group: 'sorted_set
parameters: [
destination [string! binary!] "key!"
numkeys [integer!]
key [string! binary! block!] "key!"
/weights weight [integer! block!]
/aggregate aggregate-value [word!] "enum with choices: 'SUM 'MIN 'MAX"
]
flags: [write may-allocate]
]