BitMap function and usage of Redis | Check-in function | Check-in statistics

Operation command

In Redis, the string type data structure is used to implement BitMap, so the maximum upper limit is 512M, and the conversion to bit is 2^32 bits.

The operation commands of BitMap are:

  • SETBIT: store a 0 or 1 to the specified position (offset)
  • GETBIT : Get the bit value of the specified position (offset)
  • BITCOUNT: Count the number of bits with a value of 1 in BitMap
  • BITFIELD: Operate (query, modify, increment) the value of the specified position (offset) in the bit array in the BitMap
  • BITFIELD_RO : Get the bit array in BitMap and return it in decimal form
  • BITOP: Perform bitwise operations on the results of multiple BitMaps (AND, OR, XOR)
  • BITPOS : Find the position of the first occurrence of 0 or 1 in the specified range in the bit array

insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/CSDN_SAVIOR/article/details/126560695