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
hscan seems much quicker than scan, better use hscan, only if you are sure about the key, if you need to search all keys then use scan
for name in r.hscan_iter('live_AP_460000','name'):
print(name) #for a single child key
for hash in r.hscan_iter('live_AP_460000'):
print(hash) #for all child keys
hscan is quicker than scan, only if you are searching for a correct key, else to fetch all keys with some similar pattern, go for scan. For reference. How to search a key pattern in redis hash?
Try the SCAN command like this :
r = Redis(....) #redis url
for user in r.scan_iter(match='userinfo_*'):
print(user)