Getting Started with Redis

Source: Internet
Author: User
Tags install redis

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.