I have a set of keys and i want to check if any of those are present in my redis db. How can i do so using redisson library ?
Asked
Active
Viewed 5,912 times
2 Answers
3
RedissonKeys.countExists(String... name) can help you to determine if the key exists, without knowing the type of it beforehand.
I think this what you need.

Redisson_RuiGu
- 1,012
- 10
- 13
-
so i'll have to get all the keys before making this call? – priyankatanvani Jun 22 '17 at 15:28
-
You can check them one by one, if you like, by just using one key and check if the return value is 1. – Redisson_RuiGu Jun 22 '17 at 18:20
2
You can use isExists function to check whether the key is present in redis or not.
Here is the ref link: Redis-commands-mapping-with-redisson

mn.agg
- 281
- 1
- 8