Redis-Key相关命令
序号 命令及描述 例子
1 DEL key
该命令用于在 key 存在时删除 key。 127.0.0.1:6379> del myname
(integer) 1
2 EXISTS key
检查给定 key 是否存在。 127.0.0.1:6379> exists name
(integer) 1
127.0.0.1:6379> exists person
(integer) 0
3
SET key value
设置对应的键key和值value
127.0.0.1:6379> set name yixin
OK
4
GET key
获取key所对应的值
127.0.0.1:6379> get name
"yixin"
5 KEYS pattern
查找所有符合给定模式( pattern)的 key 。 127.0.0.1:6379> keys *
1) "name"
6 EXPIRE key seconds
为给定 key 设置过期时间,以秒计。 127.0.0.1:6379> expire name 10
(integer) 1
7 TTL key
以秒为单位,返回给定 key 的剩余生存时间(TTL, time to live)。 127.0.0.1:6379> ttl name
(integer) 6
127.0.0.1:6379> ttl name
(integer) -2
127.0.0.1:6379> get name
(nil)
8 TYPE key
返回 key 所储存的值的类型。 127.0.0.1:6379> set name yixin
OK
127.0.0.1:6379> type name
string
9 PERSIST key
移除 key 的过期时间,key 将持久保持。 127.0.0.1:6379> persist mykey
(integer) 1
10 MOVE key db
将当前数据库的 key 移动到给定的数据库 db 当中。 127.0.0.1:6379> move name 1
(integer) 1
11
RENAME key newkey
修改 key 的名称
127.0.0.1:6379> rename name myname
OK
12
RENAMENX key newkey
仅当 newkey 不存在时,将 key 改名为 newkey 。
127.0.0.1:6379> renamenx mykey name
(integer) 1
13
FLUSHDB
清空当前数据库
127.0.0.1:6379> flushdb
OK
14
FLUSHALL
清除全部数据库的内容
127.0.0.1:6379[1]> flushall
OK
一、String(字符串)
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h65108.shtml
- 上一篇:Java集合框架
- 下一篇:Java集合类总结,详细且易懂
必备CSS教程Essential CSS Tutorials
- css height
- css line-height
- css width
- css min-width
- css max-width
- css min-height
- css max-height
- css border
- css background
- css float
- css clear
- css display
- css font
- css text-transform
- css英文首字母大写
- css font-variant
- css font-weight
- css font-style
- css text-decoration
- css 删除线
- div css 虚线
- css 注释
- html 注释
- css padding
- css margin
- css 文本
- css font-size
- css font-family
- css color
- css text-align
- css text-indent
- css 超链接(css a)
- css 优化压缩
- css id(css #)
- css class(css .)
- css ul li列表
- css 圆角圆边
- css 父级子级
- css 指针概念
- css cursor
- css overflow
- html px em pt网页单位
- CSS important
- CSS position
- css z-index
- css white-space
- css img图片
- css class id
- css link与@import区别
- css 选择器
- css引入html
必备HTML基础教程Essential HTML Tutorials
- html img图片标签
- html em标签(EM强调标签)
- html strong加粗(strong标签)
- html B加粗(b加粗标签)
- strong与B加粗区别
- h1 h2 h3 h4标签(html标题标签)
- html A超链接锚文本
- html注释
- html head头部标签
- html title标题标签
- html meta标签
- html link标签
- html i斜体标签
- html u下划线标签
- html s删除线标签
- html换行br标签
- html p段落标签
- p标签与br标签区别
- html div标签元素
- html span标签
- html font标签
- html script标签
- html px em pt网页单位
- html ul li列表
- ol li列表
- dl dt dd标签组
- table tr td表格
- table tr th表格
- html form表单
- html form input
- html form textarea文本区域
- html select下拉与跳转(Html select)
- html iframe框架
- html网页结构
- htm html shtml区别用法
- 网页编码charset
- UTF-8 GBK UTF8 GB2312区别联系
- 先写html还是先写CSS
- 显示扩展名
- html标签大全集合
- html常用标签
- 网页源代码是什么