How to get all Keys from Redis using redis template

后端 未结 7 1173
误落风尘
误落风尘 2020-12-31 06:30

I have been stuck with this problem with quite some time.I want to get keys from redis using redis template. I tried this.redistemplate.keys(\"*\"); but this doesn\'t fetch

7条回答
  •  -上瘾入骨i
    2020-12-31 06:52

    It did work, but seems not recommended? Because we can't use Keys command in production. I assume RedisTemplate.getConnectionFactory().getConnection().keys is calling redis Keys command. What are the alternatives?

提交回复
热议问题