Command Reference
The full low-level reference for Lux. Use this page when you want raw command access across cache, tables, vectors, queues, realtime, and time series.
If you are building an application on Lux Cloud, most teams start with Tables, the SDK, and Realtime. Drop down to raw commands when you want direct control or full Redis client compatibility.
Strings
| Command | Description |
|---|---|
SET | Set a key to a string value |
GET | Get the value of a key |
SETNX | Set a key only if it does not exist |
SETEX | Set a key with an expiration in seconds |
PSETEX | Set a key with an expiration in milliseconds |
GETSET | Set a key and return its old value |
GETDEL | Get the value and delete the key |
GETEX | Get the value and optionally set expiration |
GETRANGE | Get a substring of the string value |
SETRANGE | Overwrite part of a string at the specified offset |
MGET | Get values of multiple keys |
MSET | Set multiple keys to multiple values |
MSETNX | Set multiple keys only if none exist |
STRLEN | Get the length of a string value |
APPEND | Append a value to a key |
INCR | Increment the integer value by one |
DECR | Decrement the integer value by one |
INCRBY | Increment the integer value by a given amount |
DECRBY | Decrement the integer value by a given amount |
INCRBYFLOAT | Increment the float value by a given amount |
SETBIT | Set or clear the bit at offset in the string value |
GETBIT | Get the bit value at offset in the string value |
BITCOUNT | Count set bits in a string |
BITPOS | Find the first bit set or clear in a string |
BITOP | Perform bitwise operations between strings |
Keys
| Command | Description |
|---|---|
DEL | Delete one or more keys |
UNLINK | Delete keys asynchronously |
EXISTS | Check if one or more keys exist |
KEYS | Find all keys matching a pattern |
SCAN | Incrementally iterate keys |
TYPE | Get the type of a key |
RENAME | Rename a key |
RENAMENX | Rename a key only if the new name does not exist |
RANDOMKEY | Return a random key from the database |
COPY | Copy a key to another key |
TTL | Get the time to live in seconds |
PTTL | Get the time to live in milliseconds |
EXPIRE | Set a timeout on a key in seconds |
PEXPIRE | Set a timeout on a key in milliseconds |
EXPIREAT | Set expiration as a Unix timestamp in seconds |
PEXPIREAT | Set expiration as a Unix timestamp in milliseconds |
EXPIRETIME | Get the expiration as a Unix timestamp in seconds |
PEXPIRETIME | Get the expiration as a Unix timestamp in milliseconds |
PERSIST | Remove the expiration from a key |
DBSIZE | Return the number of keys in the database |
FLUSHDB | Remove all keys from the current database |
FLUSHALL | Remove all keys from all databases |
Lists
| Command | Description |
|---|---|
LPUSH | Prepend one or more values to a list |
RPUSH | Append one or more values to a list |
LPUSHX | Prepend a value only if the list exists |
RPUSHX | Append a value only if the list exists |
LPOP | Remove and return the first element |
RPOP | Remove and return the last element |
BLPOP | Remove and return the first element, blocking if empty |
BRPOP | Remove and return the last element, blocking if empty |
BLMOVE | Pop from one list and push to another, blocking if empty |
LLEN | Get the length of a list |
LRANGE | Get a range of elements from a list |
LINDEX | Get an element by its index |
LSET | Set the value of an element by its index |
LINSERT | Insert an element before or after another element |
LREM | Remove elements from a list |
LTRIM | Trim a list to the specified range |
LPOS | Get the index of matching elements |
LMOVE | Pop from one list and push to another |
RPOPLPUSH | Pop from the tail of one list and push to the head of another |
Hashes
| Command | Description |
|---|---|
HSET | Set one or more hash fields |
HSETNX | Set a hash field only if it does not exist |
HMSET | Set multiple hash fields |
HGET | Get the value of a hash field |
HMGET | Get values of multiple hash fields |
HDEL | Delete one or more hash fields |
HGETALL | Get all fields and values in a hash |
HKEYS | Get all field names in a hash |
HVALS | Get all values in a hash |
HLEN | Get the number of fields in a hash |
HEXISTS | Check if a hash field exists |
HINCRBY | Increment the integer value of a hash field |
HINCRBYFLOAT | Increment the float value of a hash field |
HSTRLEN | Get the length of a hash field value |
HRANDFIELD | Get one or more random fields from a hash |
HSCAN | Incrementally iterate hash fields and values |
Sets
| Command | Description |
|---|---|
SADD | Add one or more members to a set |
SREM | Remove one or more members from a set |
SMEMBERS | Get all members of a set |
SISMEMBER | Check if a value is a member of a set |
SMISMEMBER | Check membership for multiple values |
SCARD | Get the number of members in a set |
SPOP | Remove and return a random member |
SRANDMEMBER | Get one or more random members |
SMOVE | Move a member from one set to another |
SUNION | Return the union of multiple sets |
SINTER | Return the intersection of multiple sets |
SDIFF | Return the difference of multiple sets |
SUNIONSTORE | Store the union of multiple sets |
SINTERSTORE | Store the intersection of multiple sets |
SDIFFSTORE | Store the difference of multiple sets |
SINTERCARD | Return the cardinality of the intersection |
SSCAN | Incrementally iterate set members |
Sorted Sets
| Command | Description |
|---|---|
ZADD | Add one or more members with scores |
ZSCORE | Get the score of a member |
ZMSCORE | Get scores of multiple members |
ZRANK | Get the rank of a member (ascending) |
ZREVRANK | Get the rank of a member (descending) |
ZREM | Remove one or more members |
ZCARD | Get the number of members |
ZCOUNT | Count members in a score range |
ZLEXCOUNT | Count members in a lexicographic range |
ZINCRBY | Increment the score of a member |
ZRANGE | Return members in a range by index |
ZREVRANGE | Return members in a range by index (descending) |
ZRANGEBYSCORE | Return members in a score range |
ZREVRANGEBYSCORE | Return members in a score range (descending) |
ZRANGEBYLEX | Return members in a lexicographic range |
ZREVRANGEBYLEX | Return members in a lexicographic range (descending) |
ZPOPMIN | Remove and return members with the lowest scores |
ZPOPMAX | Remove and return members with the highest scores |
BZPOPMIN | Remove and return the member with the lowest score, blocking if empty |
BZPOPMAX | Remove and return the member with the highest score, blocking if empty |
ZUNIONSTORE | Store the union of multiple sorted sets |
ZINTERSTORE | Store the intersection of multiple sorted sets |
ZDIFFSTORE | Store the difference of multiple sorted sets |
ZREMRANGEBYRANK | Remove members in a rank range |
ZREMRANGEBYSCORE | Remove members in a score range |
ZREMRANGEBYLEX | Remove members in a lexicographic range |
ZSCAN | Incrementally iterate sorted set members and scores |
Geo
| Command | Description |
|---|---|
GEOADD | Add geospatial items (longitude, latitude, name) |
GEODIST | Get the distance between two members |
GEOPOS | Get the longitude and latitude of members |
GEOHASH | Get the geohash string of members |
GEOSEARCH | Search for members within a geographic area |
GEOSEARCHSTORE | Search and store results in a new key |
GEORADIUS | Query members within a radius (deprecated, use GEOSEARCH) |
GEORADIUSBYMEMBER | Query members within a radius of a member (deprecated) |
GEORADIUS_RO | Read-only variant of GEORADIUS |
GEORADIUSBYMEMBER_RO | Read-only variant of GEORADIUSBYMEMBER |
Streams
| Command | Description |
|---|---|
XADD | Append an entry to a stream |
XLEN | Get the number of entries in a stream |
XRANGE | Return a range of entries |
XREVRANGE | Return a range of entries in reverse order |
XREAD | Read entries from one or more streams |
XREADGROUP | Read entries using a consumer group |
XGROUP CREATE | Create a consumer group |
XGROUP DESTROY | Destroy a consumer group |
XACK | Acknowledge one or more pending entries |
XPENDING | Get information about pending entries |
XCLAIM | Claim ownership of pending entries |
XAUTOCLAIM | Automatically claim idle pending entries |
XDEL | Delete entries from a stream |
XTRIM | Trim the stream to a maximum length |
XINFO STREAM | Get information about a stream |
XINFO GROUPS | Get information about consumer groups |
HyperLogLog
| Command | Description |
|---|---|
PFADD | Add elements to a HyperLogLog |
PFCOUNT | Get the approximate cardinality |
PFMERGE | Merge multiple HyperLogLogs into one |
Time Series
| Command | Description |
|---|---|
TSADD | Add a sample to a time series |
TSMADD | Add samples to multiple time series |
TSGET | Get the latest sample from a time series |
TSRANGE | Query samples within a time range |
TSMRANGE | Query across multiple time series by label filter |
TSINFO | Get metadata about a time series |
Vectors
| Command | Description |
|---|---|
VSET | Store a vector with optional metadata |
VGET | Retrieve a stored vector |
VSEARCH | Search for nearest vectors |
VCARD | Get the total number of stored vectors |
Pub/Sub
| Command | Description |
|---|---|
PUBLISH | Publish a message to a channel |
SUBSCRIBE | Subscribe to one or more channels |
PSUBSCRIBE | Subscribe to channels matching a pattern |
UNSUBSCRIBE | Unsubscribe from one or more channels |
PUNSUBSCRIBE | Unsubscribe from channels matching a pattern |
KSUB
| Command | Description |
|---|---|
KSUB | Subscribe to real-time keyspace change notifications |
KUNSUB | Unsubscribe from keyspace notifications |
Tables
| Command | Description |
|---|---|
TCREATE | Create a table with typed fields and constraints |
TINSERT | Insert a row into a table |
TSELECT | Select rows with WHERE, JOIN, ORDER BY, LIMIT, and OFFSET |
TUPDATE | Update rows matching a WHERE predicate |
TDELETE | Delete rows matching a WHERE predicate |
TDROP | Drop an entire table and all its data |
TCOUNT | Count rows in a table |
TSCHEMA | Show table schema with field types and constraints |
TLIST | List all tables |
Transactions
| Command | Description |
|---|---|
MULTI | Start a transaction |
EXEC | Execute all queued commands in a transaction |
DISCARD | Discard all queued commands |
WATCH | Watch keys for changes before a transaction |
UNWATCH | Unwatch all watched keys |
Scripting
| Command | Description |
|---|---|
EVAL | Execute a Lua script |
EVALSHA | Execute a cached Lua script by SHA hash |
SCRIPT LOAD | Load a Lua script into the script cache |
SCRIPT EXISTS | Check if scripts exist in the cache |
SCRIPT FLUSH | Remove all scripts from the cache |
Sorting
| Command | Description |
|---|---|
SORT | Sort the elements of a list, set, or sorted set |
SORT_RO | Read-only variant of SORT |
Server
| Command | Description |
|---|---|
PING | Test if the server is alive |
ECHO | Echo a message back |
QUIT | Close the connection |
HELLO | Handshake with the server (RESP3) |
INFO | Get server information and statistics |
TIME | Return the current server time |
SAVE | Synchronously save the dataset to disk |
BGSAVE | Asynchronously save the dataset to disk |
LASTSAVE | Get the timestamp of the last save |
AUTH | Authenticate with the server |
CONFIG | Get or set server configuration parameters |
CLIENT | Manage client connections |
SELECT | Select the database index |
COMMAND | Get information about server commands |
OBJECT | Inspect the internals of objects |
MEMORY | Inspect memory usage |
Bitops
Bit operations are available through the Strings commands: SETBIT, GETBIT, BITCOUNT, BITPOS, and BITOP. See the Strings section above for details.