How do I to flush redis db from python redis?

2019-02-21 16:47发布

问题:

Is there a way I can flush my redis db using redis?

I'm looking for something like redis.flushdb() or redis.flushall()

回答1:

Yes, flushdb() and flushall() both exist.

check out this page, you will find them.



回答2:

Redis-py actually has this functionality:

import redis
r = redis.Redis()
r.flushdb()


标签: python redis