当前位置:网站首页>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
边栏推荐
- 编译原理课程实践——实现一个初等函数运算语言的解释器或编译器
- info [email protected] : The platform “win32“ is incompatible with this module.
- MFC 控制台打印,弹出对话框
- btrace-(字节码)动态跟踪工具
- PHP method to get the index value of the array item with the largest key value in the array
- Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly
- LeetCode 2320. 统计放置房子的方式数
- 2021-2022學年編譯原理考試重點[華僑大學]
- 18_Redis_Redis主从复制&&集群搭建
- 数据分析思维分析方法和业务知识——业务指标
猜你喜欢
随机推荐
871. 最低加油次数 : 简单优先队列(堆)贪心题
MFC console printing, pop-up dialog box
MFC CString 转 char*
JMeter script parameterization
871. Minimum refueling times: simple priority queue (heap) greedy question
How to conduct TPC-C test on tidb
LeetCode - 搜索二维矩阵
CDN 在游戏领域的应用
[C language] explain the initial and advanced levels of the pointer and points for attention (1)
Table responsive layout tips
Kityformula editor configure font size and spacing
使用 TiUP 部署 TiDB 集群
LeetCode 2310. The number of digits is the sum of integers of K
LeetCode 209. Minimum length subarray
Introduction to C language -- array
广州市应急管理局发布7月高温高湿化工安全提醒
LeetCode_字符串_简单_412.Fizz Buzz
HUSTPC2022
你不知道的Set集合
TiDB数据迁移场景综述








[email protected] : The platform “win32“ is incompatible with this module."/>