2016-03-25 Redis Redis(0X01) 阅读预计 1 分钟 | 约 150 字 Try Redis12345678SET server:name 'fido'GET server:nameDEL server:nameSET index 10INCR index [atomic operation]SETNX count 10EXPIRE count 60TTL count [time to live,-1:never expire -2:var undefined] 1234567RPUSH friends 'Alice'RPUSH friends 'Bob'LPUSH friends 'Sam'LRANGE friends 0 1 [0 -1 is tell to the end of the list]LPOP friends 'Sam'RPOP friends 'Bob'LLEN friends [list len] 12345678SADD superpowers 'flight'SADD superpowers 'x-ray vision'SADD superpowers 'reflexes'SREM superpowers 'reflexes'SISMEMBER superpowers 'reflexes'SMEMBERS superpowersSADD birdpowers 'pecking'SUNION superpowers birdpowers 12345ZADD hackers 1912 'Alan Turing' [SortedSets is Z]ZADD hackers 1906 'Grace Hopper'ZADD hackers 1940 'Alan Kay'ZRANGE 0 1... 123456HSET user:10 name 'Alan Kay' year '1940' [hash]HGETALL user:10HGET user:10 nameHSET user:11 visits 10HINCRBY user:11 visits 1 [visits = 10+1]... #Summary: L~list S~set Z~SortedSets H~hash Newer Python(0X01) Older MarkDown(MaDe)