Redis Documentary
http://redisdoc.com/
select [number]
There is 7 default databases in Redis.
use select [number]
to change the database, for example:
COMMAND "dbsize" & "keys"
dbsize : tell how many keys in that database, keys : show the keys
So there is no <key, value> in database 1
But you can see there are 4 keys in database 0
set key value
set k1 v1
get key
FLUSHDB : clear current database ; FLUSHALL : clear all databases : THIS IS BIG CAUTION
5 Data Type
String ? Hash (like Map in Java) ? List ? Set ? Zset(sorted set)
String : 512MB at most for one string
Command about keys
exist key : show if a key exists
move key db
expire key [second] : terminate the key after some seconds
ttl key : return -1 means the key is not outdated, return -2 means the key is outdated
type key: show the type of the key
String
redis use
原文:https://www.cnblogs.com/nedrain/p/13295068.html