Redis Combat _01_yucong_redis Basics

Source: Internet
Author: User

Redis Combat Summary:

About Redis

Five types of data for Redis:

2.1 String Type

The string type is a special type that contains many types, and is binary safe.

For example, a serialized object is stored, for example, a picture is stored in binary format,

such as a simple string, numeric value and so on.

Set and Get methods:

Set Value: set name Yucong take value get name (description set name multiple times overwrite)

Delete value: del name

Use SetNX (notexist) name if no settings exist, there is no need to set up, return 0,

Using Setex(expired)

Setex name ten Red set name is valid for 10s,10s and returns nil (nil in redis means null)

Replacing strings with SetRange

Set email [email protected]

SetRange Email 5 ww (5 means to replace from the first, followed by the replacement string)

2.2 Hash Type

2.3 List Type

2.4 Set Data type

Redis Combat _01_yucong_redis Basics

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.