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

Is there a @Query in spring Data Redis?

$
0
0

I have been reading about spring Data Redis which is quite similar to spring data JPA.I have a USER class that has key has user id and value as the User object. I am trying to find all the user id's (key) from the "/user" hash where this data is stored.

Spring data had this cool feature of using @Query which is apparently not working with spring data redis.

@Query("Select c.key from User c")Set<String> getAllUserKey();

I have tried the above code but it is giving me error that unrecognized property Key. I have gone through the documentation and google and don't think so this can be done using spring-data redis.

Just wanted to confirm my understanding and also would like to know what is the best way to approach this use case. I want to gather statistics around how many keys are stored under a hash and other things which would have been very easy to do with @Query


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>