Redis commonly used commands

Management commands

Serial number command Explanation
1 AUTH password Use the given password to verify the server
2 ECHO message Print the given string information
3 PING Check if the server is running
4 QUIT Close current connection
5 SELECT index Change the currently connected selected database
6 FLUSHDB Delete all keys in the current database
7 FLUSHALL Delete all keys from all databases
8 INFO [section] Get information and statistics about the server
9 SAVE Save data sets to disk synchronously
10 CLIENT LIST Get a list of client connections to the server
11 COMMAND Get array of Redis command details

key operation command

command description
DEL key This command is used to delete the key when it exists. Success 1, failure 0
DUMP key Serialize the given key and return the serialized value
EXISTS key Check if the given key exists.
EXPIRE key seconds Set the expiration time for a given key
PEXPIRE key milliseconds Set the key expiration time in milliseconds.
KEYS pattern Find all keys that match a given pattern
MOVE key db Move the key to another database
PERSIST key Delete key expiration time, have to be permanent
PTTL key Get the remaining time of key expiration (milliseconds)
RENAMENX key newkey If the new key does not exist, rename the key
TYPE key Returns the data type of the value stored in the key
TTL key View the remaining time of key expiration
Published 193 original articles · Like 13 · Visitors 40,000+

Guess you like

Origin blog.csdn.net/u013919153/article/details/105601589