Redis-Node库,使用什么数据结构?

Redis-Node library, and what data structure use?

我正在使用 redis-node 库 (http://github.com/bnoguchi/redis-node), 要求如下:

我有一组编号的项目 [1,2,3](此项目不能重复),我需要 POP/PUSH 到另一个列表,按要求的项目数量,第一个主列表并推入另一个列表。

所以,我认为更好的选择可以是排序集,因为项目不能相同,但我没有同时弹出和添加的方法(这必须在里面交易块),我需要 POP 超过 list/set 的第一项,而不是随机的。

最好的方法是什么?

如果您希望以原子方式(非事务性)做某事,那么您会得到 lua scripts. Also the redis-node library looks unmaintained, last commit is over 5 years ago and redis has evolved a lot since then, so you don't have support for lua. Instead I see this looks like a good library to use: node_redis This library has the eval command 支持

的支持