0

I am using Elastic cache and redis in my project. I have the cache where key is String and Employee object as value. Employee class is as below. Is there any way to query redis such that it returns employee whose startrange and endrange fulfill the criteria : startrange<input<endrange. Where input will be passed to the query.

Employee

int startRange;
int endRange;

Redis Entries

1   Employee{startRange=12300 ,endRange=12399 }
2   Employee{startRange=45600 ,endRange=45699 }
3   Employee{startRange=78900 ,endRange=78999 }

Input: 12345

Output

1   Employee{startRange=12300 ,endRange=12399 }
E-Riz
  • 31,431
  • 9
  • 97
  • 134
ghostrider
  • 2,046
  • 3
  • 23
  • 46
  • The short answer is, "no." Redis is a key/value store with lots of advantages for specific situations, but value querying is not one of them. – E-Riz Feb 22 '23 at 13:54
  • You've already posted a similar question. Check the comment I made, and use a sorted set. – for_stack Feb 23 '23 at 04:56

0 Answers0