# Local execution
./redis-cli
#
./redis-cli -h host -p port -a password
| # | command | effect |
|---|---|---|
| 1 | del key | Delete key |
| 2 | dump key | Serialize the key and return the serialized value |
| 3 | exists key | Check if the key exists |
| 4 | expire key seconds | Set timeout, in seconds |
| 5 | expireat key timestamp | Set timeout, receive timestamp |
| 6 | expire key milliseconds | Set timeout, in milliseconds |
| 7 | expireat key milliseconds-timestamp | Set timeout, in milliseconds, receive timestamp |
| 8 | keys pattern | View the key that matches the matching rule |
| 9 | randomkey | Return a key from the database |
| 10 | rename key new_key | Rename |
| 11 | renamex key new_key | Rename, change to new_key only if new_key does not exist |
| 12 | type key | Returns the type of value stored by the key lock |
| # | command | effect |
|---|---|---|
| 1 | set key value | Set key value |
| 2 | get key | Get the key |
| 3 | getrange key start end | Get the element in the index range of the value corresponding to the key. The index starts from 0 and is opened on both sides. |
| 4 |
Redis download Redis download address:https://github.com/MSOpenTech/redis/releases If the download is too slow, you can download domestic resources: Redis installation unzip Will be downloadedRedis-x6...
Redis master-slave replication Overview Similar to mysql's master-slave replication idea, the data of the master server is automatically synchronized to the slave server according to the configuration...
Redis overview and introduction Overview Redis is the abbreviation of Remote Dictionary Server. It is completely open source and free, written in C language, and complies with the BSD protocol. It is ...
Redis data types Redis supports five data types: string (string), hash (hash), list (list), set (collection) and zset (sorted set: ordered set). String String is the most basic type of redis. You can ...
Write in front: After reading Chapter 1, Chapter 2 is mainly used as a practical guide to tell you what you can do with Redis. In the code of this chapter, there will be more Redis commands that did n...
Several implementations of redis locking Redis lock classification The lock command table that redis can use isINCR、SETNX、SET 2. The first type of lock commandINCR The idea of this locking is that i...
2019 Unicorn Enterprise Heavy Gold Recruitment Python Engineer Standard >>> First, the introduction Redis cluster is a facility that can share data between multiple nodes. Redis cluster provi...
Preface Redis transactions can execute multiple commands at once (sequentially executed serially, no other commands will be inserted during execution, and no jams are allowed) 1 Introduction Redis tra...
Benefits of using Lua Lua scripts are executed atomically in Redis, and no other commands will be inserted during execution. Lua scripts can help developers and operation and maintenance personnel cre...
Redis transaction What is Redis transaction The transaction is a separate isolated operation: all commands in the transaction are serialized and executed sequentially. During the execution of the tran...