gpt4 book ai didi

javascript - 如何在位图中设置值并使用 ioredis 从 Redis 检索位图?

转载 作者:IT王子 更新时间:2023-10-29 06:13:20 25 4
gpt4 key购买 nike

我想使用 Redis 位图来表示值。

如果我有一个整数值,那么我希望能够将位图的相应索引设置为 1true .

我还希望能够检索整个位图并遍历它以确定“1”的位置。

有一个bitfield data structure在 Redis 中,但我不理解文档。

有以下命令:

BITFIELD GET <type> <offset>
BITFIELD SET <type> <offset> <value>

什么是 <type> field ?我应该为 <value> 使用什么值(字符串 1 ?)。

最后,在使用 ioredis 时,任何人都可以帮助我了解这些命令的语法吗? ?

最佳答案

Idk,但我会本能地选择 8

关于javascript - 如何在位图中设置值并使用 ioredis 从 Redis 检索位图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45421808/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com