Skip to content

zhiyuan2007/redis-del-with-pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

del all keys matching pattern
example:
127.0.0.1:6379> set 1.com 1
OK
127.0.0.1:6379> set 2.com 2
OK
127.0.0.1:6379> set 3.com 3
OK
127.0.0.1:6379> set 1.cn 1
OK
127.0.0.1:6379> set 2.cn 2
OK
127.0.0.1:6379> del *.com
(integer) 3
127.0.0.1:6379> keys *
1) "1.cn"
2) "2.cn"
127.0.0.1:6379> set 1.cn.com 1
OK
127.0.0.1:6379> set 1.cn.net 2
OK
127.0.0.1:6379> set 1.cn.org 3
OK
127.0.0.1:6379> del 1.cn.*
(integer) 3
127.0.0.1:6379> keys *
1) "1.cn"
2) "2.cn"
127.0.0.1:6379> del [12].cn
(integer) 2
127.0.0.1:6379> keys *
(empty list or set)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published