The Redis database is also known as the data structure database because the storage is based on key-value mode.
Where value can be a string (String), a hash (map), a list , a collection (set), and an ordered set (Zset).
Under the Redis installation directory, there is a file redis.confthat stores the basic configuration information for Redis.
By modifying This file, start again with the following command:
Redis-server Redis.conf-path
The configuration information is applied
Use the command:
Redis-cli
will open the Redis client
In this client, the configuration is obtained/modified by the following command:
Config get keyconfig set key value
It is worth noting that the set value in the client is temporary , and the value of set will not be preserved the next time the Redis server restarts.
Some basic operations (add and revise) are as follows:
Delete any key value:
Del Key1
string :
Set Key1 ' python '----del key1----Get Key1
Hash :
Hmset key1 F1 v1 F2 v2----hdel key1 f1----hget Key1 F1
List :
Lpush (rpush) K1 ' python '----lpop K1
Collection :
Sadd key1 ' python '----srem key1 ' python '----smembers key1
ordered Collection (Themember values are unique and are sorted by default in order of score from small to large ):
Zadd key1 1 ' python ' 2 ' cpp '----zrem key1 ' python '----zrange Z 0 10
----Basics of Redis Database