redis 127.0.0.1:6379> hmset post:1 title "the first post" author "JoJo" time 2016/08/25 content "this is my first post" OK
redis 127.0.0.1:6379> hmget post:1 time author 1) "2016/08/25" 2) "JoJo"
redis 127.0.0.1:6379> hgetall post:1 1) "title" 2) "the first post" 3) "author" 4) "JoJo" 5) "time" 6) "2016/08/25" 7) "content" 8) "this is my first post"
hexists key field
hsetnx key field value
redis 127.0.0.1:6379> hexists post:1 time (integer) 1 //判断是存在time字段的 redis 127.0.0.1:6379> hsetnx post:1 time 2016/08/26 (integer) 0 //不存在的话,设置time,存在的话返回0,值不变,原始值 redis 127.0.0.1:6379> hget post:1 time "2016/08/25" redis 127.0.0.1:6379> hsetnx post:1 age 23 (integer) 1 //不存在age字段,返回1,并设置age字段 redis 127.0.0.1:6379> hget post:1 age "23"
hincrby key field number
redis 127.0.0.1:6379> hincrby post:1 age 2 (integer) 25
hdel key field [field ...]
redis 127.0.0.1:6379> hkeys post:1 1) "title" 2) "author" 3) "time" 4) "content" 5) "age" redis 127.0.0.1:6379> hvals post:1 1) "the first post" 2) "JoJo" 3) "2016/08/25" 4) "this is my first post" 5) "25"
hlen key
redis 127.0.0.1:6379> hlen post:1 (integer) 5
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有