Redis commands and keys on

Redis commands

Redis commands for performing operations on the redis service.

To execute a command requires a client on redis redis service

 

grammar

The basic syntax Redis client is:

$ Repeat - cli 

========================================

Chinese garbled question

To add --raw behind redis-cli

redis-cli --raw

It can be avoided Chinese garbled.

 

===================================

 

Redis 键(key)

Redis key commands for managing redis key.

grammar

The basic syntax Redis key command is as follows:

redis 127.0.0.1:6379> COMMAND KEY_NAME

 

Redis keys command

 

Redis commands

Redis commands for performing operations on the redis service.

To execute a command requires a client on redis redis service

 

grammar

The basic syntax Redis client is:

$ Repeat - cli 

========================================

Chinese garbled question

To add --raw behind redis-cli

redis-cli --raw

It can be avoided Chinese garbled.

 

===================================

 

Redis 键(key)

Redis key commands for managing redis key.

grammar

The basic syntax Redis key command is as follows:

redis 127.0.0.1:6379> COMMAND KEY_NAME

 

Redis keys command

 

No. Command and description
1 DEL key
command is used to delete the key in the key presence.
2 DUMP key 
sequence of a given key, and return the value to be serialized.
3 EXISTS key 
to check whether a given key exists.
4 Key the EXPIRE  seconds The
given key set expiration time, in seconds.
5 EXPIREAT key timestamp 
role EXPIREAT and EXPIRE similar, are used to set the expiration time for the key. Except that the time parameter EXPIREAT accepted command is a UNIX timestamp (unix timestamp).
6 PEXPIRE key milliseconds 
set the key expiration time in milliseconds.
7 PEXPIREAT key milliseconds-timestamp 
provided key expiration time stamp (unix timestamp) in milliseconds
8 KEYS pattern 
Find all key match a given pattern (pattern) of.
9 Db the MOVE key 
will move the current database key database to a given db them.
10 PERSIST key 
remove key expiration time, key will endure.
11 PTTL key 
milliseconds return key remaining expiration time.
12 The TTL key 
in seconds, return the remaining lifetime of a given key (TTL, time to live).
13 RANDOMKEY 
returns a random key from the current database.
14 RENAME key newkey 
change the name of the key
15 RENAMENX key newkey 
only when newkey does not exist, the key renamed newkey.
16 The TYPE key 
type of return value of the stored key.

 

 

 

(Excerpt in rookie tutorial)

Guess you like

Origin www.cnblogs.com/weishenme/p/11203377.html