Commands

44s supports all common Redis commands via the RESP protocol. Any Redis client works out of the box.

String Commands

GET key
Get the value of a key. Returns nil if the key doesn't exist.
GET user:123
SET key value [EX seconds] [PX milliseconds] [NX|XX]
Set a key to a value. Optional expiration with EX (seconds) or PX (milliseconds). NX only sets if key doesn't exist, XX only if it does.
SET session:abc "token123" EX 3600
MGET key [key ...]
Get values of multiple keys in a single request.
MGET user:1 user:2 user:3
MSET key value [key value ...]
Set multiple keys in a single atomic operation.
MSET user:1 "alice" user:2 "bob"
INCR key
Atomically increment an integer value by 1. Creates the key with value 1 if it doesn't exist.
INCR page_views
INCRBY key increment
Atomically increment an integer value by the specified amount.
INCRBY inventory:item:1 50
DECR key / DECRBY key decrement
Atomically decrement an integer value.
DECR stock:item:1
APPEND key value
Append a value to an existing string.
APPEND log:today "new entry\n"
STRLEN key
Get the length of a string value.
STRLEN user:bio:123
SETNX key value
Set key only if it doesn't exist. Useful for locks.
SETNX lock:resource "owner123"
SETEX key seconds value
Set key with expiration in seconds (atomic).
SETEX cache:query:abc 300 "result"

Key Commands

DEL key [key ...]
Delete one or more keys. Returns the number of keys deleted.
DEL session:old1 session:old2
EXISTS key [key ...]
Check if keys exist. Returns the count of existing keys.
EXISTS user:123
EXPIRE key seconds
Set a key's time to live in seconds.
EXPIRE session:abc 3600
TTL key / PTTL key
Get remaining time to live in seconds (TTL) or milliseconds (PTTL).
TTL session:abc
KEYS pattern
Find all keys matching a pattern. Use SCAN for production.
KEYS user:*
SCAN cursor [MATCH pattern] [COUNT count]
Incrementally iterate keys. Recommended over KEYS for large datasets.
SCAN 0 MATCH user:* COUNT 100
TYPE key
Get the type of a key (string, list, set, zset, hash).
TYPE user:123
RENAME key newkey
Rename a key.
RENAME temp:data final:data

Hash Commands

HGET key field
Get a single field from a hash.
HGET user:123 email
HSET key field value [field value ...]
Set one or more hash fields.
HSET user:123 name "Alice" email "alice@example.com"
HMGET key field [field ...]
Get multiple hash fields.
HMGET user:123 name email role
HGETALL key
Get all fields and values from a hash.
HGETALL user:123
HDEL key field [field ...]
Delete hash fields.
HDEL user:123 temp_field
HEXISTS key field
Check if a hash field exists.
HEXISTS user:123 email
HLEN key
Get the number of fields in a hash.
HLEN user:123
HKEYS key / HVALS key
Get all field names (HKEYS) or all values (HVALS) from a hash.
HKEYS user:123

List Commands

LPUSH key value [value ...]
Push values to the head (left) of a list.
LPUSH queue:jobs "job123"
RPUSH key value [value ...]
Push values to the tail (right) of a list.
RPUSH queue:logs "entry"
LPOP key / RPOP key
Pop a value from the head (LPOP) or tail (RPOP).
LPOP queue:jobs
LRANGE key start stop
Get a range of elements. Use 0 -1 for all elements.
LRANGE recent:posts 0 9
LLEN key
Get the length of a list.
LLEN queue:jobs
LINDEX key index
Get an element by index.
LINDEX queue:jobs 0

Set Commands

SADD key member [member ...]
Add members to a set.
SADD tags:post:123 "rust" "performance"
SREM key member [member ...]
Remove members from a set.
SREM tags:post:123 "draft"
SMEMBERS key
Get all members of a set.
SMEMBERS tags:post:123
SISMEMBER key member
Check if a member exists in a set.
SISMEMBER online:users "user123"
SCARD key
Get the number of members in a set.
SCARD online:users
SUNION key [key ...] / SINTER key [key ...] / SDIFF key [key ...]
Set operations: union, intersection, difference.
SINTER user:123:friends user:456:friends

Sorted Set Commands

ZADD key score member [score member ...]
Add members with scores to a sorted set.
ZADD leaderboard 1000 "player1" 950 "player2"
ZREM key member [member ...]
Remove members from a sorted set.
ZREM leaderboard "banned_player"
ZRANGE key start stop [WITHSCORES]
Get members by rank (ascending). Add WITHSCORES to include scores.
ZRANGE leaderboard 0 9 WITHSCORES
ZREVRANGE key start stop [WITHSCORES]
Get members by rank (descending). Top 10: ZREVRANGE key 0 9.
ZREVRANGE leaderboard 0 9 WITHSCORES
ZSCORE key member
Get the score of a member.
ZSCORE leaderboard "player1"
ZRANK key member / ZREVRANK key member
Get the rank of a member (0-based).
ZREVRANK leaderboard "player1"
ZCARD key
Get the number of members in a sorted set.
ZCARD leaderboard
ZINCRBY key increment member
Increment a member's score.
ZINCRBY leaderboard 50 "player1"
ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]
Get members with scores in a range.
ZRANGEBYSCORE leaderboard 900 1000 WITHSCORES

Server Commands

PING
Test connection. Returns PONG.
PING
AUTH password
Authenticate with your API key.
AUTH your_api_key_here
INFO [section]
Get server information and statistics.
INFO
DBSIZE
Get the number of keys in the current database.
DBSIZE
FLUSHDB / FLUSHALL
Delete all keys in current database (FLUSHDB) or all databases (FLUSHALL).
FLUSHDB
SELECT index
Select a database (0-15).
SELECT 1

44s Custom Commands

44S.USAGE
Get your usage statistics for the current billing period: requests, bytes in/out, cache hits/misses.
44S.USAGE