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的帖子,获取所有密钥,通过命令行获取等,但不是关于我的具体问题。