A total of five data types:
1, Strings-string
127.0.0.1:6379> set name "Zhaoja" ok127.0.0.1:6379> Get Name "Zhaoja"
2, hashes-hash value
3. Lists-List
The Redis list is a simple list of strings, sorted in order of insertion. You can add elements to the head or tail of the Redis list
127.0.0.1:6379> lpush nlist zhaoja (integer) 1127.0.0.1:6379> lpush nlist zhaoja2 (integer) 2127.0.0.1:6379> Lrange nlist 0 101) "ZHAOJA2" 2) "Zhaoja"
4, sets-set
Redis collections are unordered collections of strings
127.0.0.1:6379> sadd nalist zhaoja1 (integer) 1127.0.0.1:6379> sadd nalist zhaoja2 (integer) 1127.0.0.1:6379> Sadd nalist zhaoja3 (integer) 1127.0.0.1:6379> smembers nalist1) "ZHAOJA3" 2) "ZHAOJA2" 3) "ZHAOJA1"
5. Set sort
Redis collections are sorted similar to Redis collections, strings are not duplicated
127.0.0.1:6379> zadd namlist 0 zhaoja1 (integer) 1127.0.0.1:6379> zadd namlist 0 zhaoja2 (integer) 1127.0.0.1:6379& Gt Zadd namlist 0 zhaoja3 (integer) 1127.0.0.1:6379> zadd namlist 0 zhaoja4 (integer) 1127.0.0.1:6379> zrangebyscore nam List 0 10001) "ZHAOJA1" 2) "ZHAOJA2" 3) "ZHAOJA3" 4) "ZHAOJA4"
Redis data types