Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 419
Hector Hernandez Avatar asked Oct 22 '25 22:10

Hector Hernandez


1 Answers

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.

like image 91
Itamar Haber Avatar answered Oct 25 '25 10:10

Itamar Haber



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!