Redis-list type operation

Source: Internet
Author: User

List type operation
Set Operation:
Lpush:lpush key Value inserts value on the left side of the list
Rpush:rpush key Value inserts value to the right of the list
Linsert:linsert Key before value1 value2 insert value1 in front of existing value2
Lset:lset key POS value Sets or modifies the vaule of the specified POS subscript
Lrem:lrem Key num value deletes the specified key of Num Value,num greater than 0 from start to finish, less than 0 from the end of the tail, equals 0 all deleted
Ltrim:ltrim key pos1 pos2 reserved pos1 to pos2 data, remaining deleted
Lpop:lpop key to delete the leftmost value
Rpop:rpop key to delete the rightmost value
Rpoplpush:rpoplpush Key1 Key2 Key1 The rightmost value is removed and added to the left of Key2

Query operation:
Lindex:lindex key POS Query key for value in POS
Llen:llen Key returns the number of value within key
Lrange:lrange key NUM1 num2 queries all value from NUM1 to num2

Redis-list type operation

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.