Module Hub Beta
LXSPLICEsrclist dstlist count [ATTACH end] [ORDER ASC|DESC|NOEFFORT]
count from one end of
srclist to one of
If less than count elements are available, it moves as much elements as possible.
A positive count removes elements from the head of
srclist, and negative from its end. The optional
ATTACH subcommand specifies the end of
dstlist to which elements are added and
end can be either 0 meaning list’s head (the default), or -1 for its tail.
To maintain the order of elements from
srclist, LSPLICE may perform extra work depending on the
count sign and
ORDER subscommand specifies how elements will appear in
destlist. The default
ASC order means that the series of attached elements will be ordered as in the source list from left to right.
DESCwill cause the elements to be reversed.
NOEFFORT avoids the extra work, so the order determined is:
Integer reply: the length of the list at
srclist after the operation.
redis> LPUSH mylist one
redis> LPUSH mylist two
redis> LPUSH mylist three
redis> LXSPLICE mylist myotherlist -2 ATTACH 0 ORDER DESC
redis> LRANGE mylist 0 -1
redis> LRANGE myotherlist 0 -1