Mode of the connection.
One of "normal"
, "subscriber"
, or "monitor"
. When the connection is
not in "normal"
mode, certain commands are not allowed.
List the ACL categories or the commands inside a category
Remove the specified ACL users and the associated rules
Returns whether the user can execute the given command without executing the command.
Generate a pseudorandom secure password to use for ACL users
Get the rules for a specific ACL user
Show helpful text about the different subcommands
List the current ACL rules in ACL config file format
Reload the ACLs from the configured ACL file
List latest events denied because of ACLs in place
Save the current ACL rules in the configured ACL file
Modify or create the rules for a specific ACL user
List the username of all the configured ACL rules
Return the name of the user associated to the current connection
Create add builtin command
Append a value to a key
Sent by cluster clients after an -ASK redirect
Authenticate to the server
Asynchronously rewrite the append-only file
Asynchronously save the dataset to disk
Count set bits in a string
Perform arbitrary bitfield integer operations on strings
Perform arbitrary bitfield integer operations on strings. Read-only variant of BITFIELD
Perform bitwise operations between strings
Find first bit set or clear in a string
Pop an element from a list, push it to another list and return it; or block until one is available
Pop elements from a list, or block until one is available
Remove and get the first element in a list, or block until one is available
Remove and get the last element in a list, or block until one is available
Remove and return members with scores in a sorted set or block until one is available
Remove and return the member with the highest score from one or more sorted sets, or block until one is available
Remove and return the member with the lowest score from one or more sorted sets, or block until one is available
Call arbitrary commands.
redis.call('set', 'foo', 'bar')
is the same as redis.set('foo', 'bar')
,
so the only case you need to use this method is when the command is not
supported by ioredis.
redis.call('set', 'foo', 'bar');
redis.call('get', 'foo', (err, value) => {
// value === 'bar'
});
Instruct the server about tracking or not keys in the next request
Get the current connection name
Get tracking notifications redirection client ID if any
Show helpful text about the different subcommands
Returns the client ID for the current connection
Returns information about the current client connection.
Kill the connection of a client
Get the list of client connections
Set client eviction mode for the current connection
Stop processing commands from clients for some time
Instruct the server whether to reply to commands
Set the current connection name
Enable or disable server assisted client side caching support
Return information about server assisted client side caching for the current connection
Unblock a client blocked in a blocking command from a different connection
Resume processing of clients that were paused
Assign new hash slots to receiving node
Assign new hash slots to receiving node
Advance the cluster config epoch
Return the number of failure reports active for a given node
Return the number of local keys in the specified hash slot
Set hash slots as unbound in receiving node
Set hash slots as unbound in receiving node
Forces a replica to perform a manual failover of its master.
Delete a node's own slots information
Remove a node from the nodes table
Return local key names in the specified hash slot
Show helpful text about the different subcommands
Provides info about Redis Cluster node state
Returns the hash slot of the specified key
Returns a list of all TCP links to and from peer nodes in cluster
Force a node cluster to handshake with another node
Return the node id
Get Cluster config for the node
List replica nodes of the specified master node
Reconfigure a node as a replica of the specified master node
Reset a Redis Cluster node
Forces the node to save cluster state on disk
Set the configuration epoch in a new node
Bind a hash slot to a specific node
Get array of cluster slots to node mappings
List replica nodes of the specified master node
Get array of Cluster slot to node mappings
Get total number of Redis commands
Get array of specific Redis command documentation
Extract keys given a full Redis command
Extract keys and access flags given a full Redis command
Show helpful text about the different subcommands
Get array of specific Redis command details, or all when no argument is given.
Get an array of Redis command names
Get the values of configuration parameters
Show helpful text about the different subcommands
Reset the stats returned by INFO
Rewrite the configuration file with the in memory configuration
Set configuration parameters to the given values
Create a connection to Redis.
This method will be invoked automatically when creating a new Redis instance
unless lazyConnect: true
is passed.
When calling this method manually, a Promise is returned, which will be resolved when the connection status is ready.
Copy a key
Create a builtin command
Return the number of keys in the selected database
A container for debugging commands
Decrement the integer value of a key by one
Decrement the integer value of a key by the given number
Define a custom command using lua script
Delete a key
Discard all commands issued after MULTI
Disconnect from Redis.
This method closes the connection immediately, and may lose some pending replies that haven't written to client. If you want to wait for the pending replies, use Redis#quit instead.
Return a serialized version of the value stored at the specified key.
Create a new instance with the same options as the current one.
Echo the given string
Disconnect from Redis.
Execute a Lua script server side
Execute a read-only Lua script server side
Execute a Lua script server side
Execute a read-only Lua script server side
Execute all commands issued after MULTI
Determine if a key exists
Set a key's time to live in seconds
Set the expiration for a key as a UNIX timestamp
Get the expiration Unix timestamp for a key
Start a coordinated failover between this server and one of its replicas.
Invoke a function
Invoke a read-only function
Remove all keys from all databases
Remove all keys from the current database
Delete a function by name
Dump all functions into a serialized binary payload
Deleting all functions
Show helpful text about the different subcommands
Kill the function currently in execution.
List information about all the functions
Create a function with the given arguments (name, code, description)
Restore all the functions on the given payload
Return information about the function currently running (name, description, duration)
Add one or more geospatial items in the geospatial index represented using a sorted set
Returns the distance between two members of a geospatial index
Returns members of a geospatial index as standard geohash strings
Returns longitude and latitude of members of a geospatial index
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point
A read-only variant for GEORADIUS
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member
A read-only variant for GEORADIUSBYMEMBER
Query a sorted set representing a geospatial index to fetch members inside an area of a box or a circle.
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.
Get the value of a key
Return supported builtin commands
Returns the bit value at offset in the string value stored at key
Get the value of a key and delete the key
Get the value of a key and optionally set its expiration
Get a substring of the string stored at a key
Set the string value of a key and return its old value
Delete one or more hash fields
Handshake with Redis
Determine if a hash field exists
Get the value of a hash field
Get all the fields and values in a hash
Increment the integer value of a hash field by the given number
Increment the float value of a hash field by the given amount
Get all the fields in a hash
Get the number of fields in a hash
Get the values of all the given hash fields
Set multiple hash fields to multiple values
Get one or multiple random fields from a hash
Incrementally iterate hash fields and associated values
Set the string value of a hash field
Set the value of a hash field, only if the field does not exist
Get the length of the value of a hash field
Get all the values in a hash
Increment the integer value of a key by one
Increment the integer value of a key by the given amount
Increment the float value of a key by the given amount
Get information and statistics about the server
Find all keys matching the given pattern
Get the UNIX time stamp of the last successful save to disk
Return a human readable latency analysis report.
Return a latency graph for the event.
Show helpful text about the different subcommands.
Return the cumulative distribution of latencies of a subset of commands or all.
Return timestamp-latency samples for the event.
Return the latest latency samples for all events.
Reset latency data for one or more events.
Find longest common substring
Get an element from a list by its index
Insert an element before or after another element in a list
Get the length of a list
Pop an element from a list, push it to another list and return it
Pop elements from a list
Display some computer art and the Redis version
Remove and get the first elements in a list
Return the index of matching elements on a list
Prepend one or multiple elements to a list
Prepend an element to a list, only if the list exists
Get a range of elements from a list
Remove elements from a list
Set the value of an element in a list by its index
Trim a list to the specified range
Outputs memory problems report
Show helpful text about the different subcommands
Show allocator internal stats
Ask the allocator to release memory
Show memory usage details
Estimate the memory usage of a key
Get the values of all the given keys
Atomically transfer a key from a Redis instance to another one.
Show helpful text about the different subcommands
List all modules loaded by the server
Load a module
Load a module with extended parameters
Unload a module
Listen for all requests received by the server in real time.
This command will create a new connection to Redis and send a MONITOR command via the new connection in order to avoid disturbing the current connection.
The callback function. If omit, a promise will be returned.
Move a key to another database
Set multiple keys to multiple values
Set multiple keys to multiple values, only if none of the keys exist
Inspect the internal encoding of a Redis object
Get the logarithmic access frequency counter of a Redis object
Show helpful text about the different subcommands
Get the time since a Redis object was last accessed
Get the number of references to the value of the key
Remove the expiration from a key
Set a key's time to live in milliseconds
Set the expiration for a key as a UNIX timestamp specified in milliseconds
Get the expiration Unix timestamp for a key in milliseconds
Adds the specified elements to the specified HyperLogLog.
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
Internal commands for debugging HyperLogLog values
Merge N different HyperLogLogs into a single one.
An internal command for testing HyperLogLog values
Ping the server
Set the value and expiration in milliseconds of a key
Listen for messages published to channels matching the given patterns
Internal command used for replication
Get the time to live for a key in milliseconds
Post a message to a channel
List active channels
Show helpful text about the different subcommands
Get the count of unique patterns pattern subscriptions
Get the count of subscribers for channels
List active shard channels
Get the count of subscribers for shard channels
Stop listening for messages posted to channels matching the given patterns
Close the connection
Return a random key from the keyspace
Enables read queries for a connection to a cluster replica node
Disables read queries for a connection to a cluster replica node
An internal command for configuring the replication stream
Make the server a replica of another instance, or promote it as master.
Reset the connection
Create a key using the provided serialized value, previously obtained using DUMP.
An internal command for migrating keys in a cluster
Return the role of the instance in the context of replication
Remove and get the last elements in a list
Append one or multiple elements to a list
Append an element to a list, only if the list exists
Add one or more members to a set
Synchronously save the dataset to disk
Incrementally iterate the keys space
Get the number of members in a set
Set the debug mode for executed scripts.
Check existence of scripts in the script cache.
Remove all the scripts from the script cache.
Show helpful text about the different subcommands
Kill the script currently in execution.
Load the specified Lua script into the script cache.
Subtract multiple sets
Subtract multiple sets and store the resulting set in a key
Change the selected database for the current connection
Set the string value of a key
Sets or clears the bit at offset in the string value stored at key
Set the value and expiration of a key
Set the value of a key, only if the key does not exist
Overwrite part of a string at key starting at the specified offset
Synchronously save the dataset to disk and then shut down the server
Intersect multiple sets
Intersect multiple sets and return the cardinality of the result
Intersect multiple sets and store the resulting set in a key
Determine if a given value is a member of a set
Make the server a replica of another instance, or promote it as master.
Get the slow log's entries
Show helpful text about the different subcommands
Get the slow log's length
Clear all entries from the slow log
Get all the members in a set
Returns the membership associated with the given elements for a set
Sort the elements in a list, set or sorted set
Sort the elements in a list, set or sorted set. Read-only variant of SORT.
Remove and return one or multiple random members from a set
Post a message to a shard channel
Get one or multiple random members from a set
Remove one or more members from a set
Incrementally iterate Set elements
Listen for messages published to the given shard channels
Get the length of the value stored in a key
Listen for messages published to the given channels
Get a substring of the string stored at a key
Add multiple sets
Add multiple sets and store the resulting set in a key
Stop listening for messages posted to the given shard channels
Swaps two Redis databases
Internal command used for replication
Return the current server time
Alters the last access time of a key(s). Returns the number of existing keys specified.
Get the time to live for a key in seconds
Determine the type stored at key
Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking.
Stop listening for messages posted to the given channels
Forget about all watched keys
Wait for the synchronous replication of all the write commands sent in the context of the current connection
Watch the given keys to determine execution of the MULTI/EXEC block
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.
Appends a new entry to a stream
Changes (or acquires) ownership of messages in a consumer group, as if the messages were delivered to the specified consumer.
Changes (or acquires) ownership of a message in a consumer group, as if the message was delivered to the specified consumer.
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.
Create a consumer group.
Create a consumer in a consumer group.
Delete a consumer from a consumer group.
Destroy a consumer group.
Show helpful text about the different subcommands
Set a consumer group to an arbitrary last delivered ID value.
List the consumers in a consumer group
List the consumer groups of a stream
Show helpful text about the different subcommands
Get information about a stream
Return the number of entries in a stream
Return information and entries from a stream consumer group pending entries list, that are messages fetched but never acknowledged.
Return a range of elements in a stream, with IDs matching the specified IDs interval
Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block.
Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block.
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
An internal command for replicating stream values
Trims the stream to (approximately if '~' is passed) a certain size
Add one or more members to a sorted set, or update its score if it already exists
Get the number of members in a sorted set
Count the members in a sorted set with scores within the given values
Subtract multiple sorted sets
Subtract multiple sorted sets and store the resulting sorted set in a new key
Increment the score of a member in a sorted set
Intersect multiple sorted sets
Intersect multiple sorted sets and return the cardinality of the result
Intersect multiple sorted sets and store the resulting sorted set in a new key
Count the number of members in a sorted set between a given lexicographical range
Remove and return members with scores in a sorted set
Get the score associated with the given members in a sorted set
Remove and return members with the highest scores in a sorted set
Remove and return members with the lowest scores in a sorted set
Get one or multiple random elements from a sorted set
Return a range of members in a sorted set
Return a range of members in a sorted set, by lexicographical range
Return a range of members in a sorted set, by score
Store a range of members from sorted set into another key
Determine the index of a member in a sorted set
Remove one or more members from a sorted set
Remove all members in a sorted set between the given lexicographical range
Remove all members in a sorted set within the given indexes
Remove all members in a sorted set within the given scores
Return a range of members in a sorted set, by index, with scores ordered from high to low
Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings.
Return a range of members in a sorted set, by score, with scores ordered from high to low
Determine the index of a member in a sorted set, with scores ordered from high to low
Incrementally iterate sorted sets elements and associated scores
Get the score associated with the given member in a sorted set
Add multiple sorted sets
Add multiple sorted sets and store the resulting sorted set in a new key
Create a Redis instance.
This is the same as new Redis()
but is included for compatibility with node-redis.
Generated using TypeDoc
This is the major component of ioredis. Use it to connect to a standalone Redis server or Sentinels.