'Issues to fully delete a hash key in redis
i'm using Redis with Python and Django and i have some trouble with the delete of Redis.
I create hash key to store multiple informations about a vehicule, but the user is finished with it, i'm deleting the key with :
r = redis.StrictRedis(host=settings.REDIS_AD, port=settings.REDIS_PORT, db='14')
key = 'TEST_GMA'
r.delete(key)
Most of the time the hash gets deleted, but sometimes it only erase part of the hash and i don't understand why since it seem to be very random.
Solution 1:[1]
use the "hdel" command to delete the redis hash which has multiple key fields.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Harshit Rai |