Redis data type Operations (iii)--list

Source: Internet
Author: User

1. Lpush

Format: Lpush ' name ' ' value '

Press value into the list named name to return the number of existing elements in the list. Press in from the beginning, first press the back out.


2. Lrange

Format: Lrange ' name ' {NUM1} {num2}

Get the element named name in list {NUM1} to {num2} subscript. The num<0 represents the countdown.


3. Rpush

Format: Rpush ' name ' ' value '

Press value into the list named name to return the number of existing elements in the list. From the tail press into the beginning, first press in first out.


4. Linsert

Format: Linsert ' name ' before ' old value ' new value '

A list named name is found inside the old value element before the new value.


5. LSet

Format: LSet ' name ' {num} ' new value '

Replace the list with the name named name with the element labeled num as new value.


6. Lrem

Format: Lrem ' name ' {num} ' value '

Delete the list with the name named Name Num value. Num>0 deleted from the beginning, num<0 deleted from the tail, num=0 all deleted.


7. LTrim

Format: LTrim ' name ' {NUM1} {num2}

Keep the element named name in list {NUM1} to {num2} subscript.


8. Lpop

Format: Lpop ' name ' ' value '

The element is popped from the list header named name and deleted.


9. Rpop

Format: Rpop ' name ' ' value '

The element is popped from the list footer named name and deleted.


Rpoplpush ' name1 ' name2 '

Format: Rpoplpush

Removes the element from the tail of the list named name1 and adds it to the head of the list named Name2.


Lindex.

Format: lindex ' name ' {num}

Returns the value labeled num in the list named name.


Llen.

Format: Llen ' name '

Returns the number of elements in the list named name.





This article is from the "Bronze Gong" blog, please be sure to keep this source http://jaeger.blog.51cto.com/11064196/1772266

Redis data type Operations (iii)--list

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.