Hasty Briefsbeta

Bilingual

<antirez>

2 days ago
  • Redis introduced a new BITFIELD command for its 7th anniversary, allowing operations on arbitrary-sized integers stored at bit offsets.
  • The command supports subcommands: SET, GET, INCRBY, and an OVERFLOW meta-command for controlling overflow behavior (SAT, WRAP, FAIL).
  • Integer types are defined with 'u' (unsigned) or 'i' (signed) followed by bit count (e.g., u8, i5, u20, i53), with u64 excluded due to protocol limits.
  • Offsets can be specified directly or with '#' to treat the string as an array of counters, simplifying multi-counter management.
  • Intended for real-time analytics, A/B testing, and memory-efficient packing of small counters, with multiple operations returning an array of results.
  • The command will be backported to stable Redis soon, with implementation details available on GitHub.