当前位置:网站首页>12_Redis_Bitmap_命令
12_Redis_Bitmap_命令
2022-07-02 12:00:00 【听*雨声】
Bitmap
位存储
统计用户信息,活跃,不活跃!登录、未登录!打卡,365打卡!两个状态的,都可以使用Bitmap !
Bitmap位图,数据结构!都是操作二进制位来进行记录,就只有0和1两个状态!
使用bitmap来记录周一到周日的打卡!
周一∶1 周二∶0 周三:0 周四:1 周五:0 周六:1 周天:0
127.0.0.1:6379> setbit sign 0 1 // 设置每天打卡的情况
(integer) 0
127.0.0.1:6379> setbit sign 1 0
(integer) 0
127.0.0.1:6379> setbit sign 2 0
(integer) 0
127.0.0.1:6379> setbit sign 3 1
(integer) 0
127.0.0.1:6379> setbit sign 4 0
(integer) 0
127.0.0.1:6379> setbit sign 5 1
(integer) 0
127.0.0.1:6379> setbit sign 6 0
(integer) 0
127.0.0.1:6379> getbit sign 3 // 查看星期四是否有打卡!
(integer) 1
127.0.0.1:6379> getbit sign 6
(integer) 0
127.0.0.1:6379> bitcount sign // 统计一周打卡的天数!
(integer) 3
边栏推荐
- 08_ 串
- 05_队列
- MFC CString to char*
- TiDB跨数据中心部署拓扑
- 电脑怎么设置扬声器播放麦克风的声音
- 07_哈希
- 如何用 Sysbench 测试 TiDB
- Some Chinese character codes in the user privacy agreement are not standardized, which leads to the display of garbled codes on the web page. It needs to be found and handled uniformly
- Tidb cross data center deployment topology
- 学习使用php实现公历农历转换的方法代码
猜你喜欢
关于网页中的文本选择以及统计选中文本长度
编译原理课程实践——实现一个初等函数运算语言的解释器或编译器
[email protected] : The platform “win32“ is incompatible with this module."/>
info [email protected] : The platform “win32“ is incompatible with this module.
LeetCode 2310. 个位数字为 K 的整数之和
MathML to latex
18_Redis_Redis主从复制&&集群搭建
C language exercises - (array)
MFC timer usage
Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly
LeetCode 209. 长度最小的子数组
随机推荐
LeetCode 2310. 个位数字为 K 的整数之和
Apprendre le Code de la méthode de conversion du calendrier lunaire grégorien en utilisant PHP
Implementation of n queen in C language
06_栈和队列转换
MFC 定时器使用
[untitled] leetcode 2321 Maximum score of concatenated array
Table responsive layout tips
Learn the method code example of converting timestamp to uppercase date using PHP
qml 弹窗框架,可定制
Internet Explorer officially retired
PHP method to get the index value of the array item with the largest key value in the array
【题解】Educational Codeforces Round 82
C语言中的printf函数和scanf函数
vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
[C language] explain the initial and advanced levels of the pointer and points for attention (1)
MFC console printing, pop-up dialog box
IE 浏览器正式退休
LeetCode 2310. The number of digits is the sum of integers of K
It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
Introduction to C language -- array