TOC

Redis 命令大全

Redis LOGO

updateAt: 2022-05-15

Core

Bitmap

  • BITCOUNT key [start end [BYTE|BIT]]
    Count set bits in a string
  • BITFIELD key GET encoding offset|[OVERFLOW WRAP|SAT|FAIL] SET encoding offset value|INCRBY encoding offset increment [GET encoding offset|[OVERFLOW WRAP|SAT|FAIL] SET encoding offset value|INCRBY encoding offset increment ...]
    Perform arbitrary bitfield integer operations on strings
  • BITFIELD_RO key GET encoding offset [encoding offset ...]
    Perform arbitrary bitfield integer operations on strings. Read-only variant of BITFIELD
  • BITOP operation destkey key [key ...]
    Perform bitwise operations between strings
  • BITPOS key bit [start [end [BYTE|BIT]]]
    Find first bit set or clear in a string
  • GETBIT key offset
    Returns the bit value at offset in the string value stored at key
  • SETBIT key offset value
    Sets or clears the bit at offset in the string value stored at key

Cluster management

  • ASKING
    Sent by cluster clients after an -ASK redirect
  • CLUSTER
    A container for cluster commands
  • CLUSTER ADDSLOTS slot [slot ...]
    Assign new hash slots to receiving node
  • CLUSTER ADDSLOTSRANGE start-slot end-slot [start-slot end-slot ...]
    Assign new hash slots to receiving node
  • CLUSTER BUMPEPOCH
    Advance the cluster config epoch
  • CLUSTER COUNT-FAILURE-REPORTS node-id
    Return the number of failure reports active for a given node
  • CLUSTER COUNTKEYSINSLOT slot
    Return the number of local keys in the specified hash slot
  • CLUSTER DELSLOTS slot [slot ...]
    Set hash slots as unbound in receiving node
  • CLUSTER DELSLOTSRANGE start-slot end-slot [start-slot end-slot ...]
    Set hash slots as unbound in receiving node
  • CLUSTER FAILOVER [FORCE|TAKEOVER]
    Forces a replica to perform a manual failover of its master.
  • CLUSTER FLUSHSLOTS
    Delete a node's own slots information
  • CLUSTER FORGET node-id
    Remove a node from the nodes table
  • CLUSTER GETKEYSINSLOT slot count
    Return local key names in the specified hash slot
  • CLUSTER HELP
    Show helpful text about the different subcommands
  • CLUSTER INFO
    Provides info about Redis Cluster node state
  • CLUSTER KEYSLOT key
    Returns the hash slot of the specified key
  • CLUSTER LINKS
    Returns a list of all TCP links to and from peer nodes in cluster
  • CLUSTER MEET ip port
    Force a node cluster to handshake with another node
  • CLUSTER MYID
    Return the node id
  • CLUSTER NODES
    Get Cluster config for the node
  • CLUSTER REPLICAS node-id
    List replica nodes of the specified master node
  • CLUSTER REPLICATE node-id
    Reconfigure a node as a replica of the specified master node
  • CLUSTER RESET [HARD|SOFT]
    Reset a Redis Cluster node
  • CLUSTER SAVECONFIG
    Forces the node to save cluster state on disk
  • CLUSTER SET-CONFIG-EPOCH config-epoch
    Set the configuration epoch in a new node
  • CLUSTER SETSLOT slot IMPORTING node-id|MIGRATING node-id|NODE node-id|STABLE
    Bind a hash slot to a specific node
  • CLUSTER SHARDS
    Get array of cluster slots to node mappings
  • CLUSTER SLAVES node-id
    List replica nodes of the specified master node
  • CLUSTER SLOTS
    Get array of Cluster slot to node mappings
  • READONLY
    Enables read queries for a connection to a cluster replica node
  • READWRITE
    Disables read queries for a connection to a cluster replica node

Connection management

  • AUTH [username] password
    Authenticate to the server
  • CLIENT
    A container for client connection commands
  • CLIENT CACHING YES|NO
    Instruct the server about tracking or not keys in the next request
  • CLIENT GETNAME
    Get the current connection name
  • CLIENT GETREDIR
    Get tracking notifications redirection client ID if any
  • CLIENT HELP
    Show helpful text about the different subcommands
  • CLIENT ID
    Returns the client ID for the current connection
  • CLIENT INFO
    Returns information about the current client connection.
  • CLIENT KILL [ip:port] [ID client-id] [TYPE NORMAL|MASTER|SLAVE|REPLICA|PUBSUB] [USER username] [ADDR ip:port] [LADDR ip:port] [SKIPME yes/no]
    Kill the connection of a client
  • CLIENT LIST [TYPE NORMAL|MASTER|REPLICA|PUBSUB] [ID client-id [client-id ...]]
    Get the list of client connections
  • CLIENT NO-EVICT ON|OFF
    Set client eviction mode for the current connection
  • CLIENT PAUSE timeout [WRITE|ALL]
    Stop processing commands from clients for some time
  • CLIENT REPLY ON|OFF|SKIP
    Instruct the server whether to reply to commands
  • CLIENT SETNAME connection-name
    Set the current connection name
  • CLIENT TRACKING ON|OFF [REDIRECT client-id] [PREFIX prefix [PREFIX prefix ...]] [BCAST] [OPTIN] [OPTOUT] [NOLOOP]
    Enable or disable server assisted client side caching support
  • CLIENT TRACKINGINFO
    Return information about server assisted client side caching for the current connection
  • CLIENT UNBLOCK client-id [TIMEOUT|ERROR]
    Unblock a client blocked in a blocking command from a different connection
  • CLIENT UNPAUSE
    Resume processing of clients that were paused
  • ECHO message
    Echo the given string
  • HELLO [protover [AUTH username password] [SETNAME clientname]]
    Handshake with Redis
  • PING [message]
    Ping the server
  • QUIT
    Close the connection
  • RESET
    Reset the connection
  • SELECT index
    Change the selected database for the current connection

Generic

  • COPY source destination [DB destination-db] [REPLACE]
    Copy a key
  • DEL key [key ...]
    Delete a key
  • DUMP key
    Return a serialized version of the value stored at the specified key.
  • EXISTS key [key ...]
    Determine if a key exists
  • EXPIRE key seconds [NX|XX|GT|LT]
    Set a key's time to live in seconds
  • EXPIREAT key unix-time-seconds [NX|XX|GT|LT]
    Set the expiration for a key as a UNIX timestamp
  • EXPIRETIME key
    Get the expiration Unix timestamp for a key
  • KEYS pattern
    Find all keys matching the given pattern
  • MIGRATE host port key|"" destination-db timeout [COPY] [REPLACE] [[AUTH password]|[AUTH2 username password]] [KEYS key [key ...]]
    Atomically transfer a key from a Redis instance to another one.
  • MOVE key db
    Move a key to another database
  • OBJECT
    A container for object introspection commands
  • OBJECT ENCODING key
    Inspect the internal encoding of a Redis object
  • OBJECT FREQ key
    Get the logarithmic access frequency counter of a Redis object
  • OBJECT HELP
    Show helpful text about the different subcommands
  • OBJECT IDLETIME key
    Get the time since a Redis object was last accessed
  • OBJECT REFCOUNT key
    Get the number of references to the value of the key
  • PERSIST key
    Remove the expiration from a key
  • PEXPIRE key milliseconds [NX|XX|GT|LT]
    Set a key's time to live in milliseconds
  • PEXPIREAT key unix-time-milliseconds [NX|XX|GT|LT]
    Set the expiration for a key as a UNIX timestamp specified in milliseconds
  • PEXPIRETIME key
    Get the expiration Unix timestamp for a key in milliseconds
  • PTTL key
    Get the time to live for a key in milliseconds
  • RANDOMKEY
    Return a random key from the keyspace
  • RENAME key newkey
    Rename a key
  • RENAMENX key newkey
    Rename a key, only if the new key does not exist
  • RESTORE key ttl serialized-value [REPLACE] [ABSTTL] [IDLETIME seconds] [FREQ frequency]
    Create a key using the provided serialized value, previously obtained using DUMP.
  • SCAN cursor [MATCH pattern] [COUNT count] [TYPE type]
    Incrementally iterate the keys space
  • SORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE destination]
    Sort the elements in a list, set or sorted set
  • SORT_RO key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA]
    Sort the elements in a list, set or sorted set. Read-only variant of SORT.
  • TOUCH key [key ...]
    Alters the last access time of a key(s). Returns the number of existing keys specified.
  • TTL key
    Get the time to live for a key in seconds
  • TYPE key
    Determine the type stored at key
  • UNLINK key [key ...]
    Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking.
  • WAIT numreplicas timeout
    Wait for the synchronous replication of all the write commands sent in the context of the current connection

Geospatial indices

  • GEOADD key [NX|XX] [CH] longitude latitude member [longitude latitude member ...]
    Add one or more geospatial items in the geospatial index represented using a sorted set
  • GEODIST key member1 member2 [M|KM|FT|MI]
    Returns the distance between two members of a geospatial index
  • GEOHASH key member [member ...]
    Returns members of a geospatial index as standard geohash strings
  • GEOPOS key member [member ...]
    Returns longitude and latitude of members of a geospatial index
  • GEORADIUS key longitude latitude radius M|KM|FT|MI [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC|DESC] [STORE key] [STOREDIST key]
    Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point
  • GEORADIUS_RO key longitude latitude radius M|KM|FT|MI [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC|DESC]
    A read-only variant for GEORADIUS
  • GEORADIUSBYMEMBER key member radius M|KM|FT|MI [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC|DESC] [STORE key] [STOREDIST key]
    Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member
  • GEORADIUSBYMEMBER_RO key member radius M|KM|FT|MI [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC|DESC]
    A read-only variant for GEORADIUSBYMEMBER
  • GEOSEARCH key FROMMEMBER member|FROMLONLAT longitude latitude BYRADIUS radius M|KM|FT|MI|BYBOX width height M|KM|FT|MI [ASC|DESC] [COUNT count [ANY]] [WITHCOORD] [WITHDIST] [WITHHASH]
    Query a sorted set representing a geospatial index to fetch members inside an area of a box or a circle.
  • GEOSEARCHSTORE destination source FROMMEMBER member|FROMLONLAT longitude latitude BYRADIUS radius M|KM|FT|MI|BYBOX width height M|KM|FT|MI [ASC|DESC] [COUNT count [ANY]] [STOREDIST]
    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.

Hash

  • HDEL key field [field ...]
    Delete one or more hash fields
  • HEXISTS key field
    Determine if a hash field exists
  • HGET key field
    Get the value of a hash field
  • HGETALL key
    Get all the fields and values in a hash
  • HINCRBY key field increment
    Increment the integer value of a hash field by the given number
  • HINCRBYFLOAT key field increment
    Increment the float value of a hash field by the given amount
  • HKEYS key
    Get all the fields in a hash
  • HLEN key
    Get the number of fields in a hash
  • HMGET key field [field ...]
    Get the values of all the given hash fields
  • HMSET key field value [field value ...]
    Set multiple hash fields to multiple values
  • HRANDFIELD key [count [WITHVALUES]]
    Get one or multiple random fields from a hash
  • HSCAN key cursor [MATCH pattern] [COUNT count]
    Incrementally iterate hash fields and associated values
  • HSET key field value [field value ...]
    Set the string value of a hash field
  • HSETNX key field value
    Set the value of a hash field, only if the field does not exist
  • HSTRLEN key field
    Get the length of the value of a hash field
  • HVALS key
    Get all the values in a hash

HyperLogLog

  • PFADD key [element [element ...]]
    Adds the specified elements to the specified HyperLogLog.
  • PFCOUNT key [key ...]
    Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
  • PFDEBUG
    Internal commands for debugging HyperLogLog values
  • PFMERGE destkey sourcekey [sourcekey ...]
    Merge N different HyperLogLogs into a single one.
  • PFSELFTEST
    An internal command for testing HyperLogLog values

List

  • BLMOVE source destination LEFT|RIGHT LEFT|RIGHT timeout
    Pop an element from a list, push it to another list and return it; or block until one is available
  • BLMPOP timeout numkeys key [key ...] LEFT|RIGHT [COUNT count]
    Pop elements from a list, or block until one is available
  • BLPOP key [key ...] timeout
    Remove and get the first element in a list, or block until one is available
  • BRPOP key [key ...] timeout
    Remove and get the last element in a list, or block until one is available
  • BRPOPLPUSH source destination timeout
    Pop an element from a list, push it to another list and return it; or block until one is available
  • LINDEX key index
    Get an element from a list by its index
  • LINSERT key BEFORE|AFTER pivot element
    Insert an element before or after another element in a list
  • LLEN key
    Get the length of a list
  • LMOVE source destination LEFT|RIGHT LEFT|RIGHT
    Pop an element from a list, push it to another list and return it
  • LMPOP numkeys key [key ...] LEFT|RIGHT [COUNT count]
    Pop elements from a list
  • LPOP key [count]
    Remove and get the first elements in a list
  • LPOS key element [RANK rank] [COUNT num-matches] [MAXLEN len]
    Return the index of matching elements on a list
  • LPUSH key element [element ...]
    Prepend one or multiple elements to a list
  • LPUSHX key element [element ...]
    Prepend an element to a list, only if the list exists
  • LRANGE key start stop
    Get a range of elements from a list
  • LREM key count element
    Remove elements from a list
  • LSET key index element
    Set the value of an element in a list by its index
  • LTRIM key start stop
    Trim a list to the specified range
  • RPOP key [count]
    Remove and get the last elements in a list
  • RPOPLPUSH source destination
    Remove the last element in a list, prepend it to another list and return it
  • RPUSH key element [element ...]
    Append one or multiple elements to a list
  • RPUSHX key element [element ...]
    Append an element to a list, only if the list exists

Pub/Sub

  • PSUBSCRIBE pattern [pattern ...]
    Listen for messages published to channels matching the given patterns
  • PUBLISH channel message
    Post a message to a channel
  • PUBSUB
    A container for Pub/Sub commands
  • PUBSUB CHANNELS [pattern]
    List active channels
  • PUBSUB HELP
    Show helpful text about the different subcommands
  • PUBSUB NUMPAT
    Get the count of unique patterns pattern subscriptions
  • PUBSUB NUMSUB [channel [channel ...]]
    Get the count of subscribers for channels
  • PUBSUB SHARDCHANNELS [pattern]
    List active shard channels
  • PUBSUB SHARDNUMSUB [channel [channel ...]]
    Get the count of subscribers for shard channels
  • PUNSUBSCRIBE [pattern [pattern ...]]
    Stop listening for messages posted to channels matching the given patterns
  • SPUBLISH channel message
    Post a message to a shard channel
  • SSUBSCRIBE channel [channel ...]
    Listen for messages published to the given shard channels
  • SUBSCRIBE channel [channel ...]
    Listen for messages published to the given channels
  • SUNSUBSCRIBE [channel [channel ...]]
    Stop listening for messages posted to the given shard channels
  • UNSUBSCRIBE [channel [channel ...]]
    Stop listening for messages posted to the given channels

Scripting and Functions

  • EVAL script numkeys [key [key ...]] [arg [arg ...]]
    Execute a Lua script server side
  • EVAL_RO script numkeys key [key ...] arg [arg ...]
    Execute a read-only Lua script server side
  • EVALSHA sha1 numkeys [key [key ...]] [arg [arg ...]]
    Execute a Lua script server side
  • EVALSHA_RO sha1 numkeys key [key ...] arg [arg ...]
    Execute a read-only Lua script server side
  • FCALL function numkeys key [key ...] arg [arg ...]
    Invoke a function
  • FCALL_RO function numkeys key [key ...] arg [arg ...]
    Invoke a read-only function
  • FUNCTION
    A container for function commands
  • FUNCTION DELETE library-name
    Delete a function by name
  • FUNCTION DUMP
    Dump all functions into a serialized binary payload
  • FUNCTION FLUSH [ASYNC|SYNC]
    Deleting all functions
  • FUNCTION HELP
    Show helpful text about the different subcommands
  • FUNCTION KILL
    Kill the function currently in execution.
  • FUNCTION LIST [LIBRARYNAME library-name-pattern] [WITHCODE]
    List information about all the functions
  • FUNCTION LOAD [REPLACE] function-code
    Create a function with the given arguments (name, code, description)
  • FUNCTION RESTORE serialized-value [FLUSH|APPEND|REPLACE]
    Restore all the functions on the given payload
  • FUNCTION STATS
    Return information about the function currently running (name, description, duration)
  • SCRIPT
    A container for Lua scripts management commands
  • SCRIPT DEBUG YES|SYNC|NO
    Set the debug mode for executed scripts.
  • SCRIPT EXISTS sha1 [sha1 ...]
    Check existence of scripts in the script cache.
  • SCRIPT FLUSH [ASYNC|SYNC]
    Remove all the scripts from the script cache.
  • SCRIPT HELP
    Show helpful text about the different subcommands
  • SCRIPT KILL
    Kill the script currently in execution.
  • SCRIPT LOAD script
    Load the specified Lua script into the script cache.

Server managment

  • ACL
    A container for Access List Control commands
  • ACL CAT [categoryname]
    List the ACL categories or the commands inside a category
  • ACL DELUSER username [username ...]
    Remove the specified ACL users and the associated rules
  • ACL DRYRUN username command [arg [arg ...]]
    Returns whether the user can execute the given command without executing the command.
  • ACL GENPASS [bits]
    Generate a pseudorandom secure password to use for ACL users
  • ACL GETUSER username
    Get the rules for a specific ACL user
  • ACL HELP
    Show helpful text about the different subcommands
  • ACL LIST
    List the current ACL rules in ACL config file format
  • ACL LOAD
    Reload the ACLs from the configured ACL file
  • ACL LOG [count|RESET]
    List latest events denied because of ACLs in place
  • ACL SAVE
    Save the current ACL rules in the configured ACL file
  • ACL SETUSER username [rule [rule ...]]
    Modify or create the rules for a specific ACL user
  • ACL USERS
    List the username of all the configured ACL rules
  • ACL WHOAMI
    Return the name of the user associated to the current connection
  • BGREWRITEAOF
    Asynchronously rewrite the append-only file
  • BGSAVE [SCHEDULE]
    Asynchronously save the dataset to disk
  • COMMAND
    Get array of Redis command details
  • COMMAND COUNT
    Get total number of Redis commands
  • COMMAND DOCS [command-name [command-name ...]]
    Get array of specific Redis command documentation
  • COMMAND GETKEYS
    Extract keys given a full Redis command
  • COMMAND GETKEYSANDFLAGS
    Extract keys and access flags given a full Redis command
  • COMMAND HELP
    Show helpful text about the different subcommands
  • COMMAND INFO [command-name [command-name ...]]
    Get array of specific Redis command details, or all when no argument is given.
  • COMMAND LIST [FILTERBY MODULE module-name|ACLCAT category|PATTERN pattern]
    Get an array of Redis command names
  • CONFIG
    A container for server configuration commands
  • CONFIG GET parameter [parameter ...]
    Get the values of configuration parameters
  • CONFIG HELP
    Show helpful text about the different subcommands
  • CONFIG RESETSTAT
    Reset the stats returned by INFO
  • CONFIG REWRITE
    Rewrite the configuration file with the in memory configuration
  • CONFIG SET parameter value [parameter value ...]
    Set configuration parameters to the given values
  • DBSIZE
    Return the number of keys in the selected database
  • DEBUG
    A container for debugging commands
  • FAILOVER [TO host port [FORCE]] [ABORT] [TIMEOUT milliseconds]
    Start a coordinated failover between this server and one of its replicas.
  • FLUSHALL [ASYNC|SYNC]
    Remove all keys from all databases
  • FLUSHDB [ASYNC|SYNC]
    Remove all keys from the current database
  • INFO [section [section ...]]
    Get information and statistics about the server
  • LASTSAVE
    Get the UNIX time stamp of the last successful save to disk
  • LATENCY
    A container for latency diagnostics commands
  • LATENCY DOCTOR
    Return a human readable latency analysis report.
  • LATENCY GRAPH event
    Return a latency graph for the event.
  • LATENCY HELP
    Show helpful text about the different subcommands.
  • LATENCY HISTOGRAM [command [command ...]]
    Return the cumulative distribution of latencies of a subset of commands or all.
  • LATENCY HISTORY event
    Return timestamp-latency samples for the event.
  • LATENCY LATEST
    Return the latest latency samples for all events.
  • LATENCY RESET [event [event ...]]
    Reset latency data for one or more events.
  • LOLWUT [VERSION version]
    Display some computer art and the Redis version
  • MEMORY
    A container for memory diagnostics commands
  • MEMORY DOCTOR
    Outputs memory problems report
  • MEMORY HELP
    Show helpful text about the different subcommands
  • MEMORY MALLOC-STATS
    Show allocator internal stats
  • MEMORY PURGE
    Ask the allocator to release memory
  • MEMORY STATS
    Show memory usage details
  • MEMORY USAGE key [SAMPLES count]
    Estimate the memory usage of a key
  • MODULE
    A container for module commands
  • MODULE HELP
    Show helpful text about the different subcommands
  • MODULE LIST
    List all modules loaded by the server
  • MODULE LOAD path [arg [arg ...]]
    Load a module
  • MODULE LOADEX path [CONFIG name value [CONFIG name value ...]] [ARGS arg [arg ...]]
    Load a module with extended parameters
  • MODULE UNLOAD name
    Unload a module
  • MONITOR
    Listen for all requests received by the server in real time
  • PSYNC replicationid offset
    Internal command used for replication
  • REPLCONF
    An internal command for configuring the replication stream
  • REPLICAOF host port
    Make the server a replica of another instance, or promote it as master.
  • RESTORE-ASKING
    An internal command for migrating keys in a cluster
  • ROLE
    Return the role of the instance in the context of replication
  • SAVE
    Synchronously save the dataset to disk
  • SHUTDOWN [NOSAVE|SAVE] [NOW] [FORCE] [ABORT]
    Synchronously save the dataset to disk and then shut down the server
  • SLAVEOF host port
    Make the server a replica of another instance, or promote it as master.
  • SLOWLOG
    A container for slow log commands
  • SLOWLOG GET [count]
    Get the slow log's entries
  • SLOWLOG HELP
    Show helpful text about the different subcommands
  • SLOWLOG LEN
    Get the slow log's length
  • SLOWLOG RESET
    Clear all entries from the slow log
  • SWAPDB index1 index2
    Swaps two Redis databases
  • SYNC
    Internal command used for replication
  • TIME
    Return the current server time

Set

  • SADD key member [member ...]
    Add one or more members to a set
  • SCARD key
    Get the number of members in a set
  • SDIFF key [key ...]
    Subtract multiple sets
  • SDIFFSTORE destination key [key ...]
    Subtract multiple sets and store the resulting set in a key
  • SINTER key [key ...]
    Intersect multiple sets
  • SINTERCARD numkeys key [key ...] [LIMIT limit]
    Intersect multiple sets and return the cardinality of the result
  • SINTERSTORE destination key [key ...]
    Intersect multiple sets and store the resulting set in a key
  • SISMEMBER key member
    Determine if a given value is a member of a set
  • SMEMBERS key
    Get all the members in a set
  • SMISMEMBER key member [member ...]
    Returns the membership associated with the given elements for a set
  • SMOVE source destination member
    Move a member from one set to another
  • SPOP key [count]
    Remove and return one or multiple random members from a set
  • SRANDMEMBER key [count]
    Get one or multiple random members from a set
  • SREM key member [member ...]
    Remove one or more members from a set
  • SSCAN key cursor [MATCH pattern] [COUNT count]
    Incrementally iterate Set elements
  • SUNION key [key ...]
    Add multiple sets
  • SUNIONSTORE destination key [key ...]
    Add multiple sets and store the resulting set in a key

Sorted Set

  • BZMPOP timeout numkeys key [key ...] MIN|MAX [COUNT count]
    Remove and return members with scores in a sorted set or block until one is available
  • BZPOPMAX key [key ...] timeout
    Remove and return the member with the highest score from one or more sorted sets, or block until one is available
  • BZPOPMIN key [key ...] timeout
    Remove and return the member with the lowest score from one or more sorted sets, or block until one is available
  • ZADD key [NX|XX] [GT|LT] [CH] [INCR] score member [score member ...]
    Add one or more members to a sorted set, or update its score if it already exists
  • ZCARD key
    Get the number of members in a sorted set
  • ZCOUNT key min max
    Count the members in a sorted set with scores within the given values
  • ZDIFF numkeys key [key ...] [WITHSCORES]
    Subtract multiple sorted sets
  • ZDIFFSTORE destination numkeys key [key ...]
    Subtract multiple sorted sets and store the resulting sorted set in a new key
  • ZINCRBY key increment member
    Increment the score of a member in a sorted set
  • ZINTER numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX] [WITHSCORES]
    Intersect multiple sorted sets
  • ZINTERCARD numkeys key [key ...] [LIMIT limit]
    Intersect multiple sorted sets and return the cardinality of the result
  • ZINTERSTORE destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX]
    Intersect multiple sorted sets and store the resulting sorted set in a new key
  • ZLEXCOUNT key min max
    Count the number of members in a sorted set between a given lexicographical range
  • ZMPOP numkeys key [key ...] MIN|MAX [COUNT count]
    Remove and return members with scores in a sorted set
  • ZMSCORE key member [member ...]
    Get the score associated with the given members in a sorted set
  • ZPOPMAX key [count]
    Remove and return members with the highest scores in a sorted set
  • ZPOPMIN key [count]
    Remove and return members with the lowest scores in a sorted set
  • ZRANDMEMBER key [count [WITHSCORES]]
    Get one or multiple random elements from a sorted set
  • ZRANGE key min max [BYSCORE|BYLEX] [REV] [LIMIT offset count] [WITHSCORES]
    Return a range of members in a sorted set
  • ZRANGEBYLEX key min max [LIMIT offset count]
    Return a range of members in a sorted set, by lexicographical range
  • ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]
    Return a range of members in a sorted set, by score
  • ZRANGESTORE dst src min max [BYSCORE|BYLEX] [REV] [LIMIT offset count]
    Store a range of members from sorted set into another key
  • ZRANK key member
    Determine the index of a member in a sorted set
  • ZREM key member [member ...]
    Remove one or more members from a sorted set
  • ZREMRANGEBYLEX key min max
    Remove all members in a sorted set between the given lexicographical range
  • ZREMRANGEBYRANK key start stop
    Remove all members in a sorted set within the given indexes
  • ZREMRANGEBYSCORE key min max
    Remove all members in a sorted set within the given scores
  • ZREVRANGE key start stop [WITHSCORES]
    Return a range of members in a sorted set, by index, with scores ordered from high to low
  • ZREVRANGEBYLEX key max min [LIMIT offset count]
    Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings.
  • ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]
    Return a range of members in a sorted set, by score, with scores ordered from high to low
  • ZREVRANK key member
    Determine the index of a member in a sorted set, with scores ordered from high to low
  • ZSCAN key cursor [MATCH pattern] [COUNT count]
    Incrementally iterate sorted sets elements and associated scores
  • ZSCORE key member
    Get the score associated with the given member in a sorted set
  • ZUNION numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX] [WITHSCORES]
    Add multiple sorted sets
  • ZUNIONSTORE destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX]
    Add multiple sorted sets and store the resulting sorted set in a new key

Stream

  • XACK key group id [id ...]
    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.
  • XADD key [NOMKSTREAM] [MAXLEN|MINID [=|~] threshold [LIMIT count]] *|id field value [field value ...]
    Appends a new entry to a stream
  • XAUTOCLAIM key group consumer min-idle-time start [COUNT count] [JUSTID]
    Changes (or acquires) ownership of messages in a consumer group, as if the messages were delivered to the specified consumer.
  • XCLAIM key group consumer min-idle-time id [id ...] [IDLE ms] [TIME unix-time-milliseconds] [RETRYCOUNT count] [FORCE] [JUSTID]
    Changes (or acquires) ownership of a message in a consumer group, as if the message was delivered to the specified consumer.
  • XDEL key id [id ...]
    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.
  • XGROUP
    A container for consumer groups commands
  • XGROUP CREATE key groupname id|$ [MKSTREAM] [ENTRIESREAD entries_read]
    Create a consumer group.
  • XGROUP CREATECONSUMER key groupname consumername
    Create a consumer in a consumer group.
  • XGROUP DELCONSUMER key groupname consumername
    Delete a consumer from a consumer group.
  • XGROUP DESTROY key groupname
    Destroy a consumer group.
  • XGROUP HELP
    Show helpful text about the different subcommands
  • XGROUP SETID key groupname id|$ [ENTRIESREAD entries_read]
    Set a consumer group to an arbitrary last delivered ID value.
  • XINFO
    A container for stream introspection commands
  • XINFO CONSUMERS key groupname
    List the consumers in a consumer group
  • XINFO GROUPS key
    List the consumer groups of a stream
  • XINFO HELP
    Show helpful text about the different subcommands
  • XINFO STREAM key [FULL [COUNT count]]
    Get information about a stream
  • XLEN key
    Return the number of entries in a stream
  • XPENDING key group [[IDLE min-idle-time] start end count [consumer]]
    Return information and entries from a stream consumer group pending entries list, that are messages fetched but never acknowledged.
  • XRANGE key start end [COUNT count]
    Return a range of elements in a stream, with IDs matching the specified IDs interval
  • XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] id [id ...]
    Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block.
  • XREADGROUP GROUP group consumer [COUNT count] [BLOCK milliseconds] [NOACK] STREAMS key [key ...] id [id ...]
    Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block.
  • XREVRANGE key end start [COUNT count]
    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
  • XSETID key last-id [ENTRIESADDED entries_added] [MAXDELETEDID max_deleted_entry_id]
    An internal command for replicating stream values
  • XTRIM key MAXLEN|MINID [=|~] threshold [LIMIT count]
    Trims the stream to (approximately if '~' is passed) a certain size

String

  • APPEND key value
    Append a value to a key
  • DECR key
    Decrement the integer value of a key by one
  • DECRBY key decrement
    Decrement the integer value of a key by the given number
  • GET key
    Get the value of a key
  • GETDEL key
    Get the value of a key and delete the key
  • GETEX key [EX seconds|PX milliseconds|EXAT unix-time-seconds|PXAT unix-time-milliseconds|PERSIST]
    Get the value of a key and optionally set its expiration
  • GETRANGE key start end
    Get a substring of the string stored at a key
  • GETSET key value
    Set the string value of a key and return its old value
  • INCR key
    Increment the integer value of a key by one
  • INCRBY key increment
    Increment the integer value of a key by the given amount
  • INCRBYFLOAT key increment
    Increment the float value of a key by the given amount
  • LCS key1 key2 [LEN] [IDX] [MINMATCHLEN len] [WITHMATCHLEN]
    Find longest common substring
  • MGET key [key ...]
    Get the values of all the given keys
  • MSET key value [key value ...]
    Set multiple keys to multiple values
  • MSETNX key value [key value ...]
    Set multiple keys to multiple values, only if none of the keys exist
  • PSETEX key milliseconds value
    Set the value and expiration in milliseconds of a key
  • SET key value [NX|XX] [GET] [EX seconds|PX milliseconds|EXAT unix-time-seconds|PXAT unix-time-milliseconds|KEEPTTL]
    Set the string value of a key
  • SETEX key seconds value
    Set the value and expiration of a key
  • SETNX key value
    Set the value of a key, only if the key does not exist
  • SETRANGE key offset value
    Overwrite part of a string at key starting at the specified offset
  • STRLEN key
    Get the length of the value stored in a key
  • SUBSTR key start end
    Get a substring of the string stored at a key

Transactions

  • DISCARD
    Discard all commands issued after MULTI
  • EXEC
    Execute all commands issued after MULTI
  • MULTI
    Mark the start of a transaction block
  • UNWATCH
    Forget about all watched keys
  • WATCH key [key ...]
    Watch the given keys to determine execution of the MULTI/EXEC block

Stack

Bloom Filter

  • BF.ADD key item
    Adds an item to a Bloom Filter
  • BF.EXISTS key item
    Checks whether an item exists in a Bloom Filter
  • BF.INFO key
    Returns information about a Bloom Filter
  • BF.INSERT key [capacity] [error] [expansion] [NOCREATE] [NONSCALING] ITEMS item [item ...]
    Adds one or more items to a Bloom Filter. A filter will be created if it does not exist
  • BF.LOADCHUNK key iterator data
    Restores a filter previously saved using SCANDUMP
  • BF.MADD key item [item ...]
    Adds one or more items to a Bloom Filter. A filter will be created if it does not exist
  • BF.MEXISTS key item [item ...]
    Checks whether one or more items exist in a Bloom Filter
  • BF.RESERVE key error_rate capacity [expansion] [NONSCALING]
    Creates a new Bloom Filter
  • BF.SCANDUMP key iterator
    Begins an incremental save of the bloom filter

Cuckoo Filter

  • CF.ADD key item
    Adds an item to a Cuckoo Filter
  • CF.ADDNX key item [item ...]
    Adds an item to a Cuckoo Filter if the item did not exist previously.
  • CF.COUNT key item
    Return the number of times an item might be in a Cuckoo Filter
  • CF.DEL key item
    Deletes an item from a Cuckoo Filter
  • CF.EXISTS key item
    Checks whether one or more items exist in a Cuckoo Filter
  • CF.INFO key
    Returns information about a Cuckoo Filter
  • CF.INSERT key [capacity] [NOCREATE] ITEMS item [item ...]
    Adds one or more items to a Cuckoo Filter. A filter will be created if it does not exist
  • CF.INSERTNX key [capacity] [NOCREATE] ITEMS item [item ...]
    Adds one or more items to a Cuckoo Filter if the items did not exist previously. A filter will be created if it does not exist
  • CF.LOADCHUNK key iterator data
    Restores a filter previously saved using SCANDUMP
  • CF.MEXISTS key item [item ...]
    Checks whether one or more items exist in a Cuckoo Filter
  • CF.RESERVE key capacity [bucketsize] [maxiterations] [expansion]
    Creates a new Cuckoo Filter
  • CF.SCANDUMP key iterator
    Begins an incremental save of the bloom filter

Count-min Sketch

  • CMS.INCRBY key item increment [item increment ...]
    Increases the count of one or more items by increment
  • CMS.INFO key
    Returns information about a sketch
  • CMS.INITBYDIM key width depth
    Initializes a Count-Min Sketch to dimensions specified by user
  • CMS.INITBYPROB key error probability
    Initializes a Count-Min Sketch to accommodate requested tolerances.
  • CMS.MERGE destination numKeys source [source ...] [WEIGHTS weight [weight ...]]
    Merges several sketches into one sketch
  • CMS.QUERY key item [item ...]
    Returns the count for one or more items in a sketch

Graph

  • GRAPH.CONFIG GET name
    Retrieves a RedisGraph configuration
  • GRAPH.CONFIG SET name value
    Updates a RedisGraph configuration
  • GRAPH.DELETE graph
    Completely removes the graph and all of its entities
  • GRAPH.EXPLAIN graph query
    Returns a query execution plan without running the query
  • GRAPH.LIST
    Lists all graph keys in the keyspace
  • GRAPH.PROFILE graph query
    Executes a query and returns an execution plan augmented with metrics for each operation's execution
  • GRAPH.QUERY graph query
    Executes the given query against a specified graph
  • GRAPH.RO_QUERY graph query
    Executes a given read only query against a specified graph
  • GRAPH.SLOWLOG graph
    Returns a list containing up to 10 of the slowest queries issued against the given graph

JSON

  • JSON.ARRAPPEND key [path] value [value ...]
    Append one or more json values into the array at path after the last element in it.
  • JSON.ARRINDEX key path value [start [stop]]
    Returns the index of the first occurrence of a JSON scalar value in the array at path
  • JSON.ARRINSERT key path index value [value ...]
    Inserts the JSON scalar(s) value at the specified index in the array at path
  • JSON.ARRLEN key [path]
    Returns the length of the array at path
  • JSON.ARRPOP key [path [index]]
    Removes and returns the element at the specified index in the array at path
  • JSON.ARRTRIM key path start stop
    Trims the array at path to contain only the specified inclusive range of indices from start to stop
  • JSON.CLEAR key [path]
    Clears all values from an array or an object and sets numeric values to 0
  • JSON.DEBUG
    Debugging container command
  • JSON.DEBUG HELP
    Shows helpful information
  • JSON.DEBUG MEMORY [key [path]]
    Reports the size in bytes of a key
  • JSON.DEL key [path]
    Deletes a value
  • JSON.FORGET key [path]
    Deletes a value
  • JSON.GET key [INDENT indent] [NEWLINE newline] [SPACE space] [paths [paths ...]]
    Gets the value at one or more paths in JSON serialized form
  • JSON.MGET key [key ...] path
    Returns the values at a path from one or more keys
  • JSON.NUMINCRBY key path value
    Increments the numeric value at path by a value
  • JSON.NUMMULTBY key path value
    Multiplies the numeric value at path by a value
  • JSON.OBJKEYS key [path]
    Returns the JSON keys of the object at path
  • JSON.OBJLEN key [path]
    Returns the number of keys of the object at path
  • JSON.RESP key [path]
    Returns the JSON value at path in Redis Serialization Protocol (RESP)
  • JSON.SET key path value [NX|XX]
    Sets or updates the JSON value at a path
  • JSON.STRAPPEND key [path] value
    Appends a string to a JSON string value at path
  • JSON.STRLEN key [path]
    Returns the length of the JSON String at path in key
  • JSON.TOGGLE key [path]
    Toggles a boolean value
  • JSON.TYPE key [path]
    Returns the type of the JSON value at path

Search

  • FT._LIST
    Returns a list of all existing indexes
  • FT.AGGREGATE index query [VERBATIM] [LOAD count field [field ...]] [TIMEOUT timeout] [LOAD *] [GROUPBY nargs property [property ...] [REDUCE function nargs arg [arg ...] [AS name] [REDUCE function nargs arg [arg ...] [AS name] ...]] [GROUPBY nargs property [property ...] [REDUCE function nargs arg [arg ...] [AS name] [REDUCE function nargs arg [arg ...] [AS name] ...]] ...]] [SORTBY nargs [property ASC|DESC [property ASC|DESC ...]] [MAX num]] [APPLY expression AS name [APPLY expression AS name ...]] [LIMIT offset num] [FILTER filter] [[WITHCURSOR] [COUNT read_size] [MAXIDLE idle_time]] [params NARGS name value [name value ...]] [DIALECT dialect]
    Adds terms to a dictionary
  • FT.ALIASADD alias index
    Adds an alias to the index
  • FT.ALIASDEL alias
    Deletes an alias from the index
  • FT.ALIASUPDATE alias index
    Adds or updates an alias to the index
  • FT.ALTER index SCHEMA ADD field options
    Adds a new field to the index
  • FT.CONFIG GET option
    Retrieves runtime configuration options
  • FT.CONFIG HELP option
    Help description of runtime configuration options
  • FT.CONFIG SET option value
    Sets runtime configuration options
  • FT.CREATE index [ON HASH|JSON] [PREFIX count prefix [prefix ...]] [LANGUAGE default_lang] [LANGUAGE_FIELD lang_attribute] [SCORE default_score] [SCORE_FIELD score_attribute] [PAYLOAD_FIELD payload_attribute] [MAXTEXTFIELDS] [TEMPORARY seconds] [NOOFFSETS] [NOHL] [NOFIELDS] [NOFREQS] [STOPWORDS count stopword [stopword ...]] SCHEMA field_name [AS alias] TEXT|TAG|NUMERIC|GEO|VECTOR [SORTABLE [UNF]] [NOINDEX] [field_name [AS alias] TEXT|TAG|NUMERIC|GEO|VECTOR [SORTABLE [UNF]] [NOINDEX] ...]
    Creates an index with the given spec
  • FT.CURSOR DEL index cursor_id
    Deletes a cursor
  • FT.CURSOR READ index cursor_id [COUNT read size]
    Reads from a cursor
  • FT.DICTADD dict term [term ...]
    Adds terms to a dictionary
  • FT.DICTDEL dict term [term ...]
    Deletes terms from a dictionary
  • FT.DICTDUMP dict
    Dumps all terms in the given dictionary
  • FT.DROPINDEX index [DD]
    Deletes the index
  • FT.EXPLAIN index query [DIALECT dialect]
    Returns the execution plan for a complex query
  • FT.EXPLAINCLI index query [DIALECT dialect]
    Returns the execution plan for a complex query
  • FT.INFO index
    Returns information and statistics on the index
  • FT.PROFILE index SEARCH|AGGREGATE [LIMITED] QUERY query
    Performs a FT.SEARCH or FT.AGGREGATE command and collects performance information
  • FT.SEARCH index query [NOCONTENT] [VERBATIM] [NOSTOPWORDS] [WITHSCORES] [WITHPAYLOADS] [WITHSORTKEYS] [FILTER numeric_field min max [FILTER numeric_field min max ...]] [GEOFILTER geo_field lon lat radius m|km|mi|ft [GEOFILTER geo_field lon lat radius m|km|mi|ft ...]] [INKEYS count key [key ...]] [INFIELDS count field [field ...]] [RETURN count identifier [AS property] [identifier [AS property] ...]] [[SUMMARIZE] [FIELDS count field [field ...]] [FRAGS num] [LEN fragsize] [SEPARATOR separator]] [[HIGHLIGHT] [FIELDS count field [field ...]] [TAGS open close]] [SLOP slop] [TIMEOUT timeout] [INORDER] [LANGUAGE language] [EXPANDER expander] [SCORER scorer] [EXPLAINSCORE] [PAYLOAD payload] [SORTBY sortby [ASC|DESC]] [LIMIT offset num] [params nargs name value [name value ...]] [DIALECT dialect]
    Searches the index with a textual query, returning either documents or just ids
  • FT.SPELLCHECK index query [DISTANCE distance] [TERMS INCLUDE|EXCLUDE dictionary [terms [terms ...]]] [DIALECT dialect]
    Performs spelling correction on a query, returning suggestions for misspelled terms
  • FT.SYNDUMP index
    Dumps the contents of a synonym group
  • FT.SYNUPDATE index synonym_group_id [SKIPINITIALSCAN] term [term ...]
    Creates or updates a synonym group with additional terms
  • FT.TAGVALS index field_name
    Returns the distinct tags indexed in a Tag field

Auto-Suggest

  • FT.SUGADD key string score [INCR] [PAYLOAD payload]
    Adds a suggestion string to an auto-complete suggestion dictionary
  • FT.SUGDEL key string
    Deletes a string from a suggestion index
  • FT.SUGGET key prefix [FUZZY] [WITHSCORES] [WITHPAYLOADS] [MAX max]
    Gets completion suggestions for a prefix
  • FT.SUGLEN key
    Gets the size of an auto-complete suggestion dictionary

T-Digest

  • TDIGEST.ADD key value weight [value weight ...]
    Adds one or more samples to a sketch
  • TDIGEST.CDF key value
    Returns the fraction of all points added which are <= value
  • TDIGEST.CREATE key compression
    Allocate the memory and initialize the t-digest
  • TDIGEST.INFO key
    Returns information about a sketch
  • TDIGEST.MAX key
    Get maximum value from the sketch
  • TDIGEST.MERGE to-key from-key
    Merges all of the values from 'from' to 'this' sketch
  • TDIGEST.MIN key
    Get minimum value from the sketch
  • TDIGEST.QUANTILE key quantile
    Returns an estimate of the cutoff
  • TDIGEST.RESET key
    Reset the sketch to zero - empty out the sketch and re-initialize it

Time Series

  • TS.ADD key timestamp value [RETENTION retentionPeriod] [ENCODING UNCOMPRESSED|COMPRESSED] [CHUNK_SIZE size] [ON_DUPLICATE BLOCK|FIRST|LAST|MIN|MAX|SUM] [LABELS label value [label value ...]]
    Append a sample to a time series
  • TS.ALTER key [RETENTION retentionPeriod] [CHUNK_SIZE size] [DUPLICATE_POLICY BLOCK|FIRST|LAST|MIN|MAX|SUM] [LABELS label value [label value ...]]
    Update the retention, chunk size, duplicate policy, and labels of an existing time series
  • TS.CREATE key [RETENTION retentionPeriod] [ENCODING UNCOMPRESSED|COMPRESSED] [CHUNK_SIZE size] [DUPLICATE_POLICY BLOCK|FIRST|LAST|MIN|MAX|SUM] [LABELS label value [label value ...]]
    Create a new time series
  • TS.CREATERULE sourceKey destKey AGGREGATION AVG|FIRST|LAST|MIN|MAX|SUM|RANGE|COUNT|STD.P|STD.S|VAR.P|VAR.S|TWA bucketDuration
    Create a compaction rule
  • TS.DECRBY key value [timestamp] [RETENTION retentionPeriod] [UNCOMPRESSED] [CHUNK_SIZE size] [LABELS label value [label value ...]]
    Decrease the value of the sample with the maximal existing timestamp, or create a new sample with a value equal to the value of the sample with the maximal existing timestamp with a given decrement
  • TS.DEL key from_timestamp to_timestamp
    Delete all samples between two timestamps for a given time series
  • TS.DELETERULE sourceKey destKey
    Delete a compaction rule
  • TS.GET key
    Get the last sample
  • TS.INCRBY key value [timestamp] [RETENTION retentionPeriod] [UNCOMPRESSED] [CHUNK_SIZE size] [LABELS label value [label value ...]]
    Increase the value of the sample with the maximal existing timestamp, or create a new sample with a value equal to the value of the sample with the maximal existing timestamp with a given increment
  • TS.INFO key [DEBUG]
    Returns information and statistics for a time series
  • TS.MADD key timestamp value [key timestamp value ...]
    Append new samples to one or more time series
  • TS.MGET [WITHLABELS|SELECTED_LABELS label1 [label1 ...]] FILTER l=v|l!=v|l=|l!=|l=(v1,v2,...)|l!=(v1,v2,...) [l=v|l!=v|l=|l!=|l=(v1,v2,...)|l!=(v1,v2,...) ...]
    Get the last samples matching a specific filter
  • TS.MRANGE fromTimestamp toTimestamp [FILTER_BY_TS Timestamp [Timestamp ...]] [FILTER_BY_VALUE min max] [WITHLABELS|SELECTED_LABELS label1 [label1 ...]] [COUNT count] [[ALIGN value] AGGREGATION AVG|FIRST|LAST|MIN|MAX|SUM|RANGE|COUNT|STD.P|STD.S|VAR.P|VAR.S|TWA bucketDuration [BUCKETTIMESTAMP] [EMPTY]] FILTER l=v|l!=v|l=|l!=|l=(v1,v2,...)|l!=(v1,v2,...) [l=v|l!=v|l=|l!=|l=(v1,v2,...)|l!=(v1,v2,...) ...] [GROUPBY label REDUCE reducer]
    Query a range across multiple time series by filters in forward direction
  • TS.MREVRANGE fromTimestamp toTimestamp [FILTER_BY_TS Timestamp [Timestamp ...]] [FILTER_BY_VALUE min max] [WITHLABELS|SELECTED_LABELS label1 [label1 ...]] [COUNT count] [[ALIGN value] AGGREGATION AVG|FIRST|LAST|MIN|MAX|SUM|RANGE|COUNT|STD.P|STD.S|VAR.P|VAR.S|TWA bucketDuration [BUCKETTIMESTAMP] [EMPTY]] FILTER l=v|l!=v|l=|l!=|l=(v1,v2,...)|l!=(v1,v2,...) [l=v|l!=v|l=|l!=|l=(v1,v2,...)|l!=(v1,v2,...) ...] [GROUPBY label REDUCE reducer]
    Query a range across multiple time-series by filters in reverse direction
  • TS.QUERYINDEX l=v|l!=v|l=|l!=|l=(v1,v2,...)|l!=(v1,v2,...) [l=v|l!=v|l=|l!=|l=(v1,v2,...)|l!=(v1,v2,...) ...]
    Get all time series keys matching a filter list
  • TS.RANGE key fromTimestamp toTimestamp [FILTER_BY_TS Timestamp [Timestamp ...]] [FILTER_BY_VALUE min max] [COUNT count] [[ALIGN value] AGGREGATION AVG|FIRST|LAST|MIN|MAX|SUM|RANGE|COUNT|STD.P|STD.S|VAR.P|VAR.S|TWA bucketDuration [BUCKETTIMESTAMP] [EMPTY]]
    Query a range in forward direction
  • TS.REVRANGE key fromTimestamp toTimestamp [FILTER_BY_TS Timestamp [Timestamp ...]] [FILTER_BY_VALUE min max] [COUNT count] [[ALIGN value] AGGREGATION AVG|FIRST|LAST|MIN|MAX|SUM|RANGE|COUNT|STD.P|STD.S|VAR.P|VAR.S|TWA bucketDuration [BUCKETTIMESTAMP] [EMPTY]]
    Query a range in reverse direction

Top-K

  • TOPK.ADD key items [items ...]
    Increases the count of one or more items by increment
  • TOPK.Count key item [item ...]
    Return the count for one or more items are in a sketch
  • TOPK.INCRBY key item increment [item increment ...]
    Increases the count of one or more items by increment
  • TOPK.INFO key
    Returns information about a sketch
  • TOPK.LIST key numKeys WITHCOUNT
    Return full list of items in Top K list
  • TOPK.QUERY key item [item ...]
    Checks whether one or more items are in a sketch
  • TOPK.RESERVE key topk [width depth decay]
    Initializes a TopK with specified parameters