【问题标题】:Removing multiple entries using SREM in ioredis?在ioredis中使用SREM删除多个条目?
【发布时间】:2021-06-26 12:23:36
【问题描述】:

我想知道使用SREM 命令删除多个条目的正确语法是什么。

当我打电话时:

const myKey = "myKey";
const entriesToRemove: string[] = ...

this.redisClient.srem(myKey, entriesToRemove);

我明白了:

ReplyError: ERR wrong number of arguments for 'srem' command

【问题讨论】:

    标签: javascript node.js typescript redis ioredis


    【解决方案1】:

    原来entriesToRemove 有时是空的。添加长度检查解决了这个问题。

    【讨论】:

      猜你喜欢
      • 2012-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-25
      • 2018-12-29
      • 2016-12-01
      • 1970-01-01
      • 2017-09-17
      相关资源
      最近更新 更多