gpt4 book ai didi

redis - 如何在redis中查询精确的整数数据

转载 作者:可可西里 更新时间:2023-11-01 11:12:25 24 4
gpt4 key购买 nike

我有这样的redis数据

HMSET cars:1 make Ferrari model 458 color red topSpeed 202
HMSET cars:2 make Porsche model 555 color yellow topSpeed 300

ZADD topSpeed 202 1
ZADD topSpeed 300 2

范围查询:ZRANGEBYSCORE topSpeed 200 300

那么如何查询exact topSpeed like 202 呢?

最佳答案

ZRANGEBYSCORE topSpeed 202 202

来自 the documentation :

Returns all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).

关于redis - 如何在redis中查询精确的整数数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55221788/

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