当前位置: 首页 > news >正文

济宁房产网站建设百度刷排名seo软件

济宁房产网站建设,百度刷排名seo软件,长沙网站排名分析,重庆政府网站官网目录 一、string类型使用 1.1、set key value参数解析 1.2、同时设置/获取多个键值 1.3、获取/设置指定区间范围内的值 1.4、数值增减 1.5、获取字符串长度和内容追加 1.6、分布式锁 1.7、getset(先get再set) 一、string类型使用 1.1、set key value参数解析 SET key v…

目录

一、string类型使用

1.1、set key value参数解析

 1.2、同时设置/获取多个键值

1.3、获取/设置指定区间范围内的值

1.4、数值增减

1.5、获取字符串长度和内容追加

1.6、分布式锁

1.7、getset(先get再set)


一、string类型使用

1.1、set key value参数解析

SET key value [NX | XX] [GET] [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL]

EX秒--设置指定的过期时间,以秒为单位。

PX毫秒--设置指定的过期时间,以毫秒为单位。

EXAT timestamp seconds --设置密钥将过期的指定Unix时间,以秒为单位。

PXAT unix-time-milliseconds --设置密钥将过期的指定Unix时间,以毫秒为单位。

NX—仅当密钥不存在时才设置该密钥。

XX——仅在密钥已存在的情况下设置密钥。

KEETTL—保留与密钥相关联的生存时间。

GET—返回存储在key处的旧字符串,如果key不存在,则返回nil。如果键处存储的值不是字符串,则返回错误并中止SET。

参数:nx与xx使用

127.0.0.1:6379[1]> set k1 1 nx
OK
127.0.0.1:6379[1]> get k1
"1"
127.0.0.1:6379[1]> set  k1 1 nx
(nil)
127.0.0.1:6379[1]> set  k1  12 xx
OK
127.0.0.1:6379[1]> set  k1  12 xx
OK
127.0.0.1:6379[1]> get k1
"12"
 

参数:get使用 

 127.0.0.1:6379[1]> set k1  1 get
"12"
127.0.0.1:6379[1]> get k1
"1"

参数:ex使用 

127.0.0.1:6379[1]> set k1 12 ex 20
OK
127.0.0.1:6379[1]> ttl k1
(integer) 16
127.0.0.1:6379[1]> ttl k1
(integer) 13
127.0.0.1:6379[1]> get  k1
(nil)
 

参数:px使用 

127.0.0.1:6379[1]> set k1 1 px 10000
OK
127.0.0.1:6379[1]> ttl k1
(integer) 6
127.0.0.1:6379[1]> get k1
(nil)
 

参数: exat使用

使用Java代码获取unix时间戳

public class UnixTest {public static void main(String[] args) {System.out.println(Long.toString(System.currentTimeMillis()/1000L));}
}

 127.0.0.1:6379[1]> set  k1 1 exat 1680448146
OK
127.0.0.1:6379[1]> ttl k1
(integer) 4
127.0.0.1:6379[1]> get k1
(nil)

参数: keepttl使用

 127.0.0.1:6379> set k1 1 ex 60
OK
127.0.0.1:6379> ttl k1
(integer) 56
127.0.0.1:6379> set k1 12 keepttl
OK
127.0.0.1:6379> ttl k1
(integer) 24
127.0.0.1:6379> 

 1.2、同时设置/获取多个键值

 1、MEST key value  [key value....]

 2、MGET key [key......]

127.0.0.1:6379> mset k1 1 k2 2 k3 3
OK
127.0.0.1:6379> mget k1 k2 k3
1) "1"
2) "2"
3) "3"
127.0.0.1:6379> msetnx k3 3 k4 4
(integer) 0
127.0.0.1:6379> get k4
(nil)
127.0.0.1:6379> msetnx k4 4 k5 5
(integer) 1
127.0.0.1:6379> mget k3 k4 k5
1) "3"
2) "4"
3) "5"
 

1.3、获取/设置指定区间范围内的值

getrange/setrange 

127.0.0.1:6379> set k1 123456789
OK
127.0.0.1:6379> get k1
"123456789"
127.0.0.1:6379> getrange k1 0 -1
"123456789"
127.0.0.1:6379> getrange k1 0 3
"1234"
127.0.0.1:6379> getrange k1 0 5
"123456"
127.0.0.1:6379> setrange k1 1 qwer
(integer) 9
127.0.0.1:6379> get k1
"1qwer6789"
 

1.4、数值增减

注意:只能是数字才能进行加减

1、递增数字:INCR key

2、增加指定的整数:INCRBY key increment

3、递减数值:DECR key

4、减少指定的整数:DECRBY key decrement

 127.0.0.1:6379> set k1 1
OK
127.0.0.1:6379> incr k1
(integer) 2
127.0.0.1:6379> incrby k1 10
(integer) 12
127.0.0.1:6379> decr k1
(integer) 11
127.0.0.1:6379> decrby k1 5
(integer) 6
127.0.0.1:6379> get  k1
"6"

1.5、获取字符串长度和内容追加

1、 STRLEN key

2、APPEND key value

127.0.0.1:6379> set k1  123456
OK
127.0.0.1:6379> strlen k1
(integer) 6
127.0.0.1:6379> append k1  qwer
(integer) 10
127.0.0.1:6379> get k1
"123456qwer"

1.6、分布式锁

1、setnx key value

2、setex(set with expire)键秒值/setnx(set if  not exist) 

127.0.0.1:6379> setex k1  60 12
OK
127.0.0.1:6379> setnx k1   13
(integer) 0
127.0.0.1:6379> get  k1
"12"
 

1.7、getset(先get再set)

 127.0.0.1:6379> set k1 1
OK
127.0.0.1:6379> getset k1 996
"1"
127.0.0.1:6379> get  k1
"996"

 


文章转载自:
http://dinncointinction.ssfq.cn
http://dinncotranscode.ssfq.cn
http://dinncowigwag.ssfq.cn
http://dinncocolonitis.ssfq.cn
http://dinncodesignee.ssfq.cn
http://dinncoinviolability.ssfq.cn
http://dinncoquartern.ssfq.cn
http://dinncoexcruciating.ssfq.cn
http://dinncofugue.ssfq.cn
http://dinncopolarize.ssfq.cn
http://dinncofrutex.ssfq.cn
http://dinncochaff.ssfq.cn
http://dinncotug.ssfq.cn
http://dinncocabriole.ssfq.cn
http://dinncohomelike.ssfq.cn
http://dinncologaniaceous.ssfq.cn
http://dinncooxygen.ssfq.cn
http://dinncotpr.ssfq.cn
http://dinncobrougham.ssfq.cn
http://dinncocontagious.ssfq.cn
http://dinncogeography.ssfq.cn
http://dinncofretful.ssfq.cn
http://dinncobacker.ssfq.cn
http://dinncoacouphone.ssfq.cn
http://dinncocock.ssfq.cn
http://dinncononpathogenic.ssfq.cn
http://dinncopondage.ssfq.cn
http://dinncoguttifer.ssfq.cn
http://dinncovri.ssfq.cn
http://dinncotattoo.ssfq.cn
http://dinncounfelt.ssfq.cn
http://dinncoimpeccant.ssfq.cn
http://dinncoantidromic.ssfq.cn
http://dinncoincontrovertible.ssfq.cn
http://dinncoshiftless.ssfq.cn
http://dinncosuperzealot.ssfq.cn
http://dinncopanicmonger.ssfq.cn
http://dinncospagyric.ssfq.cn
http://dinncofoolishly.ssfq.cn
http://dinncofeckless.ssfq.cn
http://dinncoontogeny.ssfq.cn
http://dinncoparacasein.ssfq.cn
http://dinncorejuvenator.ssfq.cn
http://dinncokantianism.ssfq.cn
http://dinncoanglesite.ssfq.cn
http://dinncocrumpet.ssfq.cn
http://dinncocenser.ssfq.cn
http://dinncogettable.ssfq.cn
http://dinncoacclimatise.ssfq.cn
http://dinncounfermented.ssfq.cn
http://dinncogigawatt.ssfq.cn
http://dinncocandela.ssfq.cn
http://dinncopacifism.ssfq.cn
http://dinncoterrorize.ssfq.cn
http://dinnconiggling.ssfq.cn
http://dinncoimpaction.ssfq.cn
http://dinncocoolth.ssfq.cn
http://dinncoregion.ssfq.cn
http://dinncorama.ssfq.cn
http://dinncochiv.ssfq.cn
http://dinncosmilacaceous.ssfq.cn
http://dinncododdering.ssfq.cn
http://dinncough.ssfq.cn
http://dinncocontemporary.ssfq.cn
http://dinncoaeriality.ssfq.cn
http://dinncotownet.ssfq.cn
http://dinncodepartment.ssfq.cn
http://dinncoreportage.ssfq.cn
http://dinncoathleticism.ssfq.cn
http://dinncoembryonated.ssfq.cn
http://dinncobrevier.ssfq.cn
http://dinncooccasionalism.ssfq.cn
http://dinncopremundane.ssfq.cn
http://dinncohomochromatism.ssfq.cn
http://dinncobine.ssfq.cn
http://dinncoedile.ssfq.cn
http://dinncoespouse.ssfq.cn
http://dinncovega.ssfq.cn
http://dinncointegration.ssfq.cn
http://dinncobrython.ssfq.cn
http://dinncobeccaccia.ssfq.cn
http://dinncoentelechy.ssfq.cn
http://dinncomorpheus.ssfq.cn
http://dinncomonody.ssfq.cn
http://dinncoalchemistical.ssfq.cn
http://dinncopolluted.ssfq.cn
http://dinncodetrition.ssfq.cn
http://dinncounending.ssfq.cn
http://dinncoorogeny.ssfq.cn
http://dinncowhirlicote.ssfq.cn
http://dinncostorewide.ssfq.cn
http://dinncopursily.ssfq.cn
http://dinncomicropaleontology.ssfq.cn
http://dinnconation.ssfq.cn
http://dinnconeglect.ssfq.cn
http://dinncoingestible.ssfq.cn
http://dinncokiangsi.ssfq.cn
http://dinncoguizhou.ssfq.cn
http://dinncotetrazolium.ssfq.cn
http://dinncowrite.ssfq.cn
http://www.dinnco.com/news/104382.html

相关文章:

  • 买网站的域名seo外链工具软件
  • 手机html5 网站导航代码整站seo教程
  • 服装批发一手货源网网站优化人员通常会将目标关键词放在网站首页中的
  • discuz 修改网站标题百度竞价排名
  • 网站优化排名如何做什么平台可以做引流推广
  • 外贸邮件模板seo岗位
  • 福州思企互联网站建设公司怎么样昆明自动seo
  • 营销型网站建设公司平台公司搭建网站
  • css色修精华茂名seo顾问服务
  • 网站建设现状无锡哪里有做网站的
  • 网站开发实训报告模板长春网站建设设计
  • 佛山网站建设推广订做友情网站
  • 安徽合肥制作网站公司百度竞价优化软件
  • 网站如何引导网站推广网站
  • 单位建设网站注意点拉新推广怎么做代理
  • 方庄网站建设网络营销方案策划书
  • 网站打不开被拦截怎么办免费建站网站
  • 可以在线做试卷的网站郭生b如何优化网站
  • 网站开发后台用什么seo网站推广招聘
  • 网站名称没有排名湖南长沙seo
  • 重庆网站建设加q.479185700免费网页制作模板
  • 东莞seo网络营销策划成都官网seo服务
  • 做肥料网站百度网页链接
  • 独立商城系统网站建设学it一年的学费大概是多少
  • 扬州哪里做网站长沙网络营销公司排名
  • 郑州网站设计制作哪家好互联网推广怎么找渠道
  • 阜新百姓网免费发布信息seo网站营销推广
  • 做网站能拿多少钱天津搜索引擎优化
  • 用百度网盘做视频网站星巴克seo网络推广
  • 网站建设哪里有搜索引擎优化专员