c# - 在 Redis 中使用字段值查询数据

标签 c# redis servicestack.redis

请帮帮我。 我使用 C# servicestack.redis 库将数据存储在 Redis 中。在本例中,我存储了 4 个类的数据。对于这种情况,我想使用一个值从 Redis 恢复所有数据。

enter image description here

在上图中,它显示了 4 个 id,每个都是我正在通过 C# 加载到 Redis 的类的名称。对于 CompanyList 类(在我的程序中),我只想恢复值“Expediente”为“100037”时的数据,但我不知道如何使用或可以使用哪些 Redis 命令。

当然,在照片中,我有索引值 (12381635),但在我的程序中,我想通过仅使用“Expediente”和“100037”来恢复所有特定数据。

最佳答案

Redis 允许通过键而不是值访问数据。如果您需要查找给定值,则必须对其进行“索引”。参见 https://redis.io/topics/indexes寻求指导。

关于c# - 在 Redis 中使用字段值查询数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49013502/

相关文章:

C# 如何向另一个子例程发送中断?

lua - 为什么在redis重启后我不能在redis中运行lua脚本?

c# - StackExchange.Redis可以用来存储POCO吗?

c# - StackExchange.Redis 和 ServiceStack.Redis 的区别

redis - 如何使用 ServiceStack.Redis 删除 redis 哈希中的多个字段?

c# - 原始文件比 GZip 解压文件大

c# - WCF客户端代理实现

c# - 下拉列表中的空值(for)

django - Openresty : pass a request to FastCGI if data does not found in redis cache 中带有 nginx 的 Lua

java - 使用 Aggregator + Redis 的死锁