redis:List類型的操做命令redis
1:lpush/rpush:添加值,格式是rpush list的key item項的值,值能夠是多個索引
2:lrange:按索引範圍獲取值,格式是lrange list的key 起始索引終止索引,-1表示最後一個索引rem
3:lindex:獲取指定索引的值,格式是lindex list的key 索引號it
4:lpop/rpop:彈出值,格式是lpop list的keyList
5:llen:獲取元素個數,格式是llen list的keyim
6:lrem:刪除元素,格式是lrem list的key 數量item項的值,數量可正負,表示從左或右刪除,若是數di
量爲0,表示刪除所有與給定值相等的項時間
7:ltrim:保留指定索引區間的元素,格式是ltrim list的key 起始索引結束索引push
8:blpop/brpop:彈出值,格式是blpop list的key值過時時間,key能夠是多個,若是沒有值,會一值等index
待有值,直到過時
9:rpoplpush:將元素從一個列表轉移到另一個列表,格式是rpoplpush 源list的key值目的list的key
值
10:brpoplpush:將元素從一個列表轉移到另一個列表,格式是brpoplpush 源list的key值目的list的
key值過時時間
11:lset:設置指定索引的值,格式是lset list的key 索引新的值
12:linsert:插入元素,格式是linsert list的key before|after 定位查找的值添加的值