Redis Command Reference

Redis Command Reference

🚧 This page is under construction

Estimated completion: July 2026

Current progress: Planning phase


📋 Planned Content

This page will contain a complete reference for all Redis commands, grouped by command type:

1. General Commands

Command Description Syntax
PING Test connection PING [message]
INFO View server info INFO [section]
DBSIZE View key count DBSIZE
FLUSHDB Clear current database FLUSHDB
FLUSHALL Clear all databases FLUSHALL

2. Key Commands

Command Description Syntax
SET Set key value SET key value [EX seconds] [PX ms] [NX|XX]
GET Get key value GET key
DEL Delete key DEL key [key ...]
EXISTS Check key existence EXISTS key [key ...]
EXPIRE Set expiration EXPIRE key seconds
TTL View expiration time TTL key
KEYS Find keys KEYS pattern
SCAN Iterate keys SCAN cursor [MATCH pattern] [COUNT count]

3. String Commands

Command Description Syntax
SET Set string SET key value
GET Get string GET key
INCR Increment INCR key
DECR Decrement DECR key
APPEND Append APPEND key value
STRLEN Get length STRLEN key

4. Hash Commands

Command Description Syntax
HSET Set field HSET key field value
HGET Get field HGET key field
HGETALL Get all fields HGETALL key
HDEL Delete field HDEL key field [field ...]
HKEYS Get all field names HKEYS key
HVALS Get all values HVALS key

5. List Commands

Command Description Syntax
LPUSH Left insert LPUSH key value [value ...]
RPUSH Right insert RPUSH key value [value ...]
LPOP Left pop LPOP key
RPOP Right pop RPOP key
LRANGE Get range LRANGE key start stop
LLEN Get length LLEN key

6. Set Commands

Command Description Syntax
SADD Add element SADD key member [member ...]
SREM Remove element SREM key member [member ...]
SMEMBERS Get all elements SMEMBERS key
SISMEMBER Check element existence SISMEMBER key member
SINTER Intersection SINTER key [key ...]
SUNION Union SUNION key [key ...]
SDIFF Difference SDIFF key [key ...]

7. Sorted Set Commands

Command Description Syntax
ZADD Add element ZADD key score member [score member ...]
ZRANGE Get range ZRANGE key start stop [WITHSCORES]
ZREVRANGE Reverse range ZREVRANGE key start stop [WITHSCORES]
ZSCORE Get score ZSCORE key member
ZRANK Get rank ZRANK key member
ZREM Remove element ZREM key member [member ...]


📝 Contribution Guide

If you'd like to help complete this page:

  1. Refer to the official documentation: https://redis.io/commands/
  2. Add command descriptions following the structure above
  3. Include syntax, parameters, return values, and examples
  4. Submit a Pull Request

💡 Tip: Need to look up a specific command? Use Redis's built-in help system:

HELP <command>
100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏