gpt4 book ai didi

redis - redis 中是否有等同于 python bisect 命令的命令?

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

我是 python 的对分函数的粉丝,例如,我使用它来获取列表中的项目最接近(在我的例子中是左边)到我拥有的另一个项目。

redis中有这个吗?我不太了解 Redis 术语。

例如:

li = [1,2,5,6,10,15,19,20]
itm = 12

the closest value on the left to 12 would be: 10

最佳答案

没有。 command documentation 中没有任何内容表明 Redis 中原生存在这样的函数。

你可以执行Lua带有 EVAL and friends 的脚本,因此如果您找到或编写执行此功能的 Lua 脚本,您可以加载并执行它。

关于redis - redis 中是否有等同于 python bisect 命令的命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38641320/

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