码迷,mamicode.com
首页 > 其他好文 > 详细

redis key模糊查找

时间:2020-05-11 15:47:57      阅读:746      评论:0      收藏:0      [点我收藏+]

标签:https   dep   relevant   net   括号   att   one   zha   nec   

https://blog.csdn.net/zhaipengfei1231/article/details/80819454?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-6.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-6.nonecase

https://blog.csdn.net/honer123/article/details/79698828?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1.nonecase

*:通配任意多个字符

?:通配单个字符

[]:通配括号内的某一个字符

returnstringRedisTemplate.keys("*"+ pattern + "*");

return stringRedisTemplate.keys("?" + pattern);

return stringRedisTemplate.keys("[" + pattern + "]");

 

127.0.0.1:6379> keys *ge
1) "vge"
2) "sge"
3) "zge"
4) "age"
127.0.0.1:6379> keys *e
1) "vge"
2) "sge"
3) "name"
4) "zge"
5) "age"
6) "namee"
7) "allSeedName"
127.0.0.1:6379> keys ?e
(empty list or set)
127.0.0.1:6379> keys ?ge
1) "vge"
2) "sge"
3) "zge"
4) "age"
127.0.0.1:6379> keys ???
1) "vge"
2) "sge"
3) "www"
4) "zge"
5) "age"

redis key模糊查找

标签:https   dep   relevant   net   括号   att   one   zha   nec   

原文地址:https://www.cnblogs.com/caesar-the-great/p/12869084.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!