首页 > 其他 > 详细

redis use

时间:2020-07-13 19:20:16      阅读:68      评论:0      收藏:0      [点我收藏+]

Redis Documentary

http://redisdoc.com/

select [number]

There is 7 default databases in Redis.
use select [number] to change the database, for example:
技术分享图片

COMMAND "dbsize" & "keys"

dbsize : tell how many keys in that database, keys : show the keys
技术分享图片
So there is no <key, value> in database 1


技术分享图片
But you can see there are 4 keys in database 0

set key value

set k1 v1


技术分享图片
技术分享图片

get key

技术分享图片

FLUSHDB : clear current database ; FLUSHALL : clear all databases : THIS IS BIG CAUTION

5 Data Type

String ? Hash (like Map in Java) ? List ? Set ? Zset(sorted set)

String : 512MB at most for one string

Command about keys

exist key : show if a key exists

技术分享图片


技术分享图片

move key db

技术分享图片


技术分享图片

expire key [second] : terminate the key after some seconds

ttl key : return -1 means the key is not outdated, return -2 means the key is outdated

type key: show the type of the key

技术分享图片

String

redis use

原文:https://www.cnblogs.com/nedrain/p/13295068.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!