Using redis python client, I want to list all of the keys with a certain pattern using scan_iter()
.
import redis
r = redis.StrictRedis(host=host, port=port, db=db)
count = 0
for key in r.scan_iter(match='pattern'):
count += 1
print(key)
print(count)
Running the above code will output 2 different number of keys and I am getting them alternately. Why am I getting those 2 different output? Is there any session or transaction involved in the connnection?