Redis Database Common Operations

Source: Internet
Author: User

    • Start
sudo service redis start
    • Stop it
sudo service redis stop
    • Restart
sudo service Redis restart  
    • 启动客户端
Redis-cli

First, the database

Redis default of 16 databases (0-15)

Switch database

Redis supports the following data types by default

1 . String Type

Add, modify

Add multiple key values


Append value

Get value

Get Multiple values

2. Key operation

 View all Keys

 View the key that contains a in the name

Determines whether the key exists, returns 1 if present, does not exist return 0

Delete keys and their corresponding values

3 , hash type

Add, modify


Setting multiple properties

Gets all properties of the specified key

Gets the value of a property 

Get the values of multiple properties

Get the value of all properties

Delete the key value of the entire hash

4. List Type

Increase

Get Data

Modify

Delete

5. Set Type

Increase

Get element

Delete Element

6. Zset type (ordered set)

Increase

Get element

Gets the member between the weight values

Weight of the return value

Delete


Redis Database Common Operations

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.