How to remove all elements in Redis? I tried with the following snippet code from this post but didn't work.
I've such this:
import redis
from pprint import pprint
cli = redis.Redis('localhost')
dict_ = { # dummy
'tags': {'module': 'voltage', 'station': 'SNMP'},
'metric_name': 'voltage',
'value': 222,
'time': '2018-11-13T15:25:09'
}
cli.hmset("pythonDict", dict_)
for key in cli.keys('prefix:*'): # Didn't work.
cli.delete(key)
pprint(cli.hgetall("pythonDict"))
Still, the previous data appeared from dict_
.