Small white Learning Redis database Diary (2017-06-13)

Source: Internet
Author: User
Redis 127.0.0.1:6379> Lpush Runoobkey Redis
(integer) 1
Redis 127.0.0.1:6379> Lpush Runoobkey MongoDB
(integer) 2
Redis 127.0.0.1:6379> lpush Runoobkey MySQL
(integer) 3

This is the command when the Redis database is inserted into the list collection, but when the query results

Redis 127.0.0.1:6379> lrange Runoobkey 0 10

1) "MySQL"
2) "MongoDB"
3) "Redis"

The output order is reversed, not sorted in order of insertion, what is this?

Later thought of push this keyword, its insertion is similar to a bucket, you put in the first thing is at the bottom, so take the time is also the last out. This is also true when we insert a list, which is equivalent to inserting data into the list header.

Small white Learning Redis database Diary (2017-06-13)

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.