重庆品牌网站建设抖音代运营会不会看到以往的数据
web/
2025/10/1 16:13:36/
文章来源:
重庆品牌网站建设,抖音代运营会不会看到以往的数据,国内空间站,xampp php网站模板redis的list类型#xff0c;可以存储双向链表作为value#xff0c;key保留有head和tail指针可以指向双向链表的头和尾#xff0c;因此可以直接从头或尾对list进行操作。 全部命令如下#xff1a;
127.0.0.1:6379 help listBLMOVE source destination LEFT|RIGHT LEFT|…redis的list类型可以存储双向链表作为valuekey保留有head和tail指针可以指向双向链表的头和尾因此可以直接从头或尾对list进行操作。 全部命令如下
127.0.0.1:6379 help listBLMOVE source destination LEFT|RIGHT LEFT|RIGHT timeoutsummary: Pop an element from a list, push it to another list and return it; or block until one is availablesince: 6.2.0BLMPOP timeout numkeys key [key ...] LEFT|RIGHT [COUNT count]summary: Pop elements from a list, or block until one is availablesince: 7.0.0BLPOP key [key ...] timeoutsummary: Remove and get the first element in a list, or block until one is availablesince: 2.0.0BRPOP key [key ...] timeoutsummary: Remove and get the last element in a list, or block until one is availablesince: 2.0.0BRPOPLPUSH source destination timeoutsummary: Pop an element from a list, push it to another list and return it; or block until one is availablesince: 2.2.0LINDEX key indexsummary: Get an element from a list by its indexsince: 1.0.0LINSERT key BEFORE|AFTER pivot elementsummary: Insert an element before or after another element in a listsince: 2.2.0LLEN keysummary: Get the length of a listsince: 1.0.0LMOVE source destination LEFT|RIGHT LEFT|RIGHTsummary: Pop an element from a list, push it to another list and return itsince: 6.2.0LMPOP numkeys key [key ...] LEFT|RIGHT [COUNT count]summary: Pop elements from a listsince: 7.0.0LPOP key [count]summary: Remove and get the first elements in a listsince: 1.0.0LPOS key element [RANK rank] [COUNT num-matches] [MAXLEN len]summary: Return the index of matching elements on a listsince: 6.0.6LPUSH key element [element ...]summary: Prepend one or multiple elements to a listsince: 1.0.0LPUSHX key element [element ...]summary: Prepend an element to a list, only if the list existssince: 2.2.0LRANGE key start stopsummary: Get a range of elements from a listsince: 1.0.0LREM key count elementsummary: Remove elements from a listsince: 1.0.0LSET key index elementsummary: Set the value of an element in a list by its indexsince: 1.0.0LTRIM key start stopsummary: Trim a list to the specified rangesince: 1.0.0RPOP key [count]summary: Remove and get the last elements in a listsince: 1.0.0RPOPLPUSH source destinationsummary: Remove the last element in a list, prepend it to another list and return itsince: 1.2.0RPUSH key element [element ...]summary: Append one or multiple elements to a listsince: 1.0.0RPUSHX key element [element ...]summary: Append an element to a list, only if the list existssince: 2.2.0
下面示例如下
lpushlpush key e1 e2 e3…将数据从头那里推入list lpoplpop key将数据从head弹出 这样2个同向的命令组合起来可以实现一个队列。 反向的命令组合起来可以实现一个栈。
127.0.0.1:6379 lpush k1 a b c d e
(integer) 5
127.0.0.1:6379 lpop k1
e
127.0.0.1:6379 lpop k1
d
lrange lrange key start end展示key对应的从下标start到end的所有数据
127.0.0.1:6379 lrange k1 0 -1
1) c
2) b
3) a
lindexlindex key index 返回key对应的List指定index位置的值
127.0.0.1:6379 lrange k1 0 -1
1) f
2) e
3) d
4) c
5) b
6) a
127.0.0.1:6379 lindex k1 1
e
lsetlset key index value在key对应的list中的指定下标处替换为value
127.0.0.1:6379 lset k1 3 x
OK
127.0.0.1:6379 lrange k1 0 -1
1) f
2) e
3) d
4) x
5) b
6) a
lremlrem key num target删除key对应的list中的target元素如果num大于0从head开始删num个。如果num小于0从tail开始删abs(num)个
127.0.0.1:6379 lrange k3 0 -11) d2) 63) a4) 55) c6) 47) a8) 39) b
10) 2
11) a
12) 1
127.0.0.1:6379 lrem k3 2 a
(integer) 2
127.0.0.1:6379 lrange k3 0 -11) d2) 63) 54) c5) 46) 37) b8) 29) a
10) 1
linsertlinsert key before/after element value在key对应的list中在元素element不是下标之前或者之后添加value
127.0.0.1:6379 lrange k3 0 -11) d2) 63) 54) c5) 46) 37) b8) 29) a
10) 1
127.0.0.1:6379 linsert k3 after 6 a
(integer) 11
127.0.0.1:6379 lrange k3 0 -11) d2) 63) a4) 55) c6) 47) 38) b9) 2
10) a
11) 1
llenllen key返回长度 redis的List类型有很多关于下标的操作也可以将其抽象为一个数组来使用。
127.0.0.1:6379 llen k3
(integer) 10
blpopblpop key time弹出指定key对应的list中的一个元素如果list没有元素或者不存在key对应的这个list则阻塞等待time指定的时间0表示一直等待单位是s。
127.0.0.1:6379 blpop k1 0阻塞期间如果list有了元素则会中断阻塞并弹出
127.0.0.1:6379 blpop k1 0
1) k1
2) a
(35.77s)
ltrimltrim key start end删除key对应的list start和end之外的两端的元素
127.0.0.1:6379 lrange k4 0 -1
1) f
2) e
3) d
4) c
5) b
6) a
127.0.0.1:6379 ltrim k4 1 -2
OK
127.0.0.1:6379 lrange k4 0 -1
1) e
2) d
3) c
4) b
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/85138.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!