gpt4 book ai didi

redis - 我如何知道给定键的值的数据类型?

转载 作者:IT王子 更新时间:2023-10-29 05:54:27 26 4
gpt4 key购买 nike

我似乎无法找到有关 Redis 命令的有用信息。我想知道给定键值的数据类型。例如,要列出我的数据库的所有键,我运行以下命令:

 keys *

在我的设置中,我得到以下结果:

 1) "username:testuser:uid"
2) "uid:1:first"
3) "uid:1:email"
4) "uid:1:hash"
5) "global:next_uid"
6) "members:email"
7) "uid:1:username"
8) "uid:1:last"
9) "uid:1:salt"
10) "uid:1:access"
11) "uid:1:company"
12) "email:testuser@gmail.com:uid"
13) "uid:1:phone_number"

我如何知道键 members:email 包含什么数据类型?我尝试运行 get members:email 但我收到错误 (error) ERR Operation against a key holding the wrong kind of value

有什么想法吗?

最佳答案

你可以使用 type 命令: http://redis.io/commands/type

关于redis - 我如何知道给定键的值的数据类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19077591/

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