Jedis运用scan删除正则匹配的key
import redis.clients.jedis.Jedis; import redis.clients.jedis.ScanParams; import redis.clients.jedis.ScanResult; import java.util.List; import java.util.Set; public class RedisApplication { private static String prefix = "ws:"; static Jedis jedis; static { jedis = new Jedis("localhost"); System.out.println("连接成功"); } public static void main(String[] args) { // init(); list(); // scan(); del(); } private static void del() { Long count = jedis.del("abc"); System.out.println(count); } private static void scan() { ScanParams params = new ScanParams(); params.match("ws:*"); // params.count(3);