Search code examples
c#redisservicestack.redis

Query data, in Redis, by using a field value


Please help me. I've stored data, in Redis, by using C# servicestack.redis libraries. In this case, I stored data from 4 classes. For this case, I want to recover all data, from Redis, by using a value.

enter image description here

In the image above, it's shown 4 ids, each one is the name of the class that I'm loading, by C#, into Redis. I want to recover, for CompanyList class (in my program), only data when the value "Expediente" is "100037", but I don't know how or which Redis commands I can use.

In the photo, of course, I've the index value (12381635), but in my program I want to recover all particular data by using "Expediente" and "100037" only.


Solution

  • Redis allows access to data by key, not value. If you need to look up a given value, you'll have to "index" it. See https://redis.io/topics/indexes for guidance.