list¶
commonly used comnmands
l/rpush key val [val ...]: pushe value(s) onto the left/right end of the listl/rpop key: remove and return left/right most item from the listlindex key offset: return item at the given offsetlrange key start end-incl: return items from start to end inclusiveltrim key start end-incl: trim the list to only include items between start and end inclusivelrem key n element: remove first n occurrences of elements: n>0:head->tail, n<0:tail->head, n=0:all
block pop and item move
bl/rpop key- [key ...] timeout: pop left/right most item from first non-empty LIST, or wait timeout in seconds for an itemrpoplpush src-key dest-key: pop right most item from source and lpush to dest, also return the item to the userrpoplpush src-key dest-key timeout: pop right most item from source and lpush to dest, also return to the user, and wait up to timeout if source is empty