如何在redis的列表中获取项目的位置以及为什么有lrem而没有分配命令

How to get the position of an item in a list in redis AND why there are lrem and no llocation command

我的意思是,lrem 可以删除任何给定的元素,复杂度是 O(n),在 Redis 中获取列表的位置也应该是 O(n) lrem 和 llocation(list location) 是相同的操作,为什么没有 API 称为 llocation 而有一个更复杂的 API 称为 lrem,真的不明白,谁能给我提示?

感谢@for_stack,您有答案了。 在 6.0.6 和更新版本中,有一个名为 LPOS 的 API,它可以工作。