当前位置:网站首页>Crazy God redis notes 03
Crazy God redis notes 03
2022-07-20 19:40:00 【Matcha flavored watermelon juice】
redis Basic knowledge description of :
redis The default is 16 A database :
Let's go and have a look at our redis.conf The configuration file :
We can see that there is indeed 16 A database .
By default, the first one is 0 A database .
have access to select To switch databases :
We can use select Switch database , It can be used dbsize Look at the size of the database . Different data can be stored in different databases .
We add a data to the database :
Different databases can be used to store different values .
We can also use keys * View all of the database key
We can use flushall Empty all libraries .
It can also be used. flushdb Empty the current library :
Redis It's single threaded :
I emptied the previous Library .
Then we add another data :
We can also use it here exists Determine whether a key exists :
1 On behalf of there 0 nonexistence .
We are now using these commands in the native generation . Behind us we will use springboot To operate these commands to do the same thing .
We can also use move To move one of our key To another database .
We can use the database 1 See our this name The attribute is .
Now let's do some operations :
Now let's set up our name The survival time is 10 second ,10 Seconds after the failure .
We can go through ttl see name The remaining life of , Here we can see ,name It's dead 2 The second .
We found that name It's gone .
We can put cookie Save it like this , You can also do hot news , Set the lifetime of hotspot data like this , Update after expiration . You can also use this when doing single sign on .
Now let's judge our key What kind of :
We can see our current key All are string Type of , Later we will go set Some other types .
边栏推荐
猜你喜欢
【开源】MagicData-RAMC :180小时中文对话式语音数据集正式发布
The difference between BL and LDR jump program
使用 Abp.Zero 搭建第三方登录模块(四):微信小程序开发
通俗易懂:MOS管基本知识
RES-BSANP白藜芦醇白蛋白纳米粒/包裹紫杉烷类的白蛋白纳米颗粒载体
开发者必读:2022年移动应用运营增长洞察白皮书
Memory distribution in C language and program running (BSS segment, data segment, code segment, stack)
Magic data is listed in the top 100 digital economy of Internet Weekly 2022
干货 | 训练AI模型找不到数据?20个精选开源社区收藏好!
RedHat installation process and problems
随机推荐
Mysql索引整理总结
Solution to YACs product of two numbers
Magichub重口音对话语音识别挑战赛报名开始
Static关键字和block块的经典小案例
Magichub accent dialogue speech recognition challenge registration begins
深度学习 —— 深度理解归一化和BatchNorm(理论部分)
Map的三种遍历方法回顾
【转载】pycharm打包.py程序为可执行文件exe
女神节特辑 | 专访中国AI女神张晴晴从女学霸到女企业家的蜕变
百度sem竞价避坑
最全的多线程应用教程---总结详细
redis集群搭建(一主两从三哨兵)完整版带验证报告
Preparation of water-soluble sodium ferulate albumin nanoparticles /p-cs-np loaded teniposide multilayer coated serum protein nanoparticles
MySQL基础——数据库索引与事务
FileBeat6.4 快速上手
Synchronization scripts between XSync servers
INH-RFP-BSA-NPs载INH和RFP白蛋白纳米粒/载卡巴他赛的白蛋白纳米粒的制备
/Bin/bash^m: bad interpreter: no file or directory
cout格式化输出常用函数及标志汇总
关于IO流和String常见的一些面试题