Redis ERR“保存”命令的参数数量错误

问题描述 投票:0回答:1

我正在尝试使用 Redis 在我的后端应用程序上进行缓存,但就在我使用保存功能时,它出现了此错误:

ERR wrong number of arguments for 'save' command

这是redis服务中的save函数:

async save(key: string, value: string) {
    console.log('Enotro ak redisDataService');
    await this.redisClient.set(key, value);
    return false;
}

这是我尝试使用它的代码:

async findAll() {
    const findTypeIdent = await this.typeIdentRepository.find();
    const redi = await this.redisDataService.save('key_test',JSON.stringify(findTypeIdent))
    return redi
}

我正在使用

Redis server v=7.2.0

你能帮我知道发生了什么事吗?

redis nest
1个回答
0
投票

根据错误消息,发送到 Redis 的似乎是 Redis

save
命令,而不是
set
命令。

© www.soinside.com 2019 - 2024. All rights reserved.