First, the relevant operation of key
1. Delete
Del key1 Key2 ... Keyn
Function: Delete 1 or more keys.
Return value: The nonexistent key is ignored, returning the number of really deleted keys.
2. Renaming
Rename Key Newkey
Function: Assign a new key to key name note: If Newkey already exists, then the Newkey's original value is overwritten.
3. Random key
Function: Returns the Random key.
4. Is there a key
Exists key
Function: Determines whether the key exists, returns 1/0.
5. Determine the type of key
Type key
Function: Returns the type of the value stored by key with String,link,set,order set, hash.
6. Query the valid time of key
TTL key
Function: Query Key's lifetime return: number of seconds.
7. Set the validity period of key
Expire key seconds
Function: Sets the life cycle of the key, in seconds.
Persist key
Function: Specifies that the key is permanently valid.
Redis Basic Learning (iii)-key actions