Redis scan command match option does not work in Python

前端 未结 2 1565
太阳男子
太阳男子 2021-01-04 18:20

I use python redis to match some infomation by using match option? but it doesn\'t work.

 import redis
 import REDIS

 class UserCache(object):
    def __ini         


        
2条回答
  •  星月不相逢
    2021-01-04 19:02

    Try the SCAN command like this :

    r = Redis(....) #redis url
    for user in r.scan_iter(match='userinfo_*'):
      print(user)
    

提交回复
热议问题