1
我正在使用Spring Data RedisTemplate(不是Repository)。一切工作正常Spring Redis通過通配符獲取值
template.opsForValues().get("mykey:1")
但我有一些更復雜的按鍵,如 「爲MyObject:somesituation:1」 和 「MyObject來:anothersituation:2」 等等。我需要做的是這樣的:
template.opsForValues().get("myobject:somesituation:*")
通過通配符,我想獲得的所有值在「somesituation」,不管是它的ID。
使用redis命令行,我沒有問題。
Obs .:我正在使用反應模板,不知道(相信)如果這可能是問題。 Obs2:經過研究,我剛剛找到關於Spring Repository的帖子,獲取所有密鑰,通過命令行獲取等,但不是關於我的具體問題。