Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Spring Redis Get Values by Wildcard Keys

$
0
0

I am using Spring Data RedisTemplate (not Repository). Everything works fine with

template.opsForValues().get("mykey:1")

But I have some more complex keys such as "myobject:somesituation:1" and "myobject:anothersituation:2" and so on. I need to do something like:

template.opsForValues().get("myobject:somesituation:*")

With the wildcard, I would like to get all values in the "somesituation", no matter what is its id.

Using redis command line, I have no problem.

Obs.: I am using reactive template, don't know(believe) if this could be the problem. Obs2: After a research, I have just found posts about Spring Repository, get all keys, get by command line, etc. But not about my specific problem.


Viewing all articles
Browse latest Browse all 2204

Trending Articles