Windows installation, download compressed package, unzip directly can use Https://github.com/dmajkic/redis/downloads
Open Service side: Redis-server.exe
Open Client: Redis-cli.exe
Redis supports five types of data: string (String), hash (hash), list, set (set), and Zset (sorted set: Ordered set)
Basic syntax: COMMAND key_name [VALUE]
Keys pattern finds all keys that satisfy the pattern, * can be any number of characters
Strings Command (String)
Set key value
Get key
... ...
Hashing (hash)
Hash is a string type of field and value mapping table, hash is particularly suitable for storing objects.
Hmset Zoro Name "Roronoazoro" age "20" ...
Hgetall Zoro
Hget Zoro Name
...
Listing (list)
Lpush alist astring
Lrange alist 0 5
Lpop alist
Rpush alist astring
Rpop alist
......
Collection (SET)
Set is an unordered collection of type string. The collection member is unique.
Sadd Aset Amember
Smembers Aset
Spop Aset
......
Ordered set (Sorted set)
An ordered set is a collection of elements of type string, as well as a collection, and does not allow duplicate members
Each element is associated with a double-type fraction. Redis is a small-to-large ordering of the members in a collection by fractions.
Working with Redis with Python
Pip Install Redis
Import= Redis. Redis () R.set () r.get ( ) ...
Getting Started with Redis