Open Roam-Cooper opened 7 years ago
I can work on this, do you mean delete with hash keys ?
what about if the user want to use key:* as a key, how this should work ?
maybe you can delete the hash entirely if you want to delete all the keys
Frankly, if you have a bunch of related keys that commonly need to die together, I wonder if you should simply use a hash anyway. Then a single del kills all of them and it avoids sharing issues on cluster etc. You can still read/write/remove single items via hset / hget / hdel.
Del is already varadic but you need to know the keys you want to delete. "del x y z" works fine. I doubt a "dellike foo*" would ever be added due to both the sharding (cluster) issue, and the performance impact (see: "keys" command).
what about if the user want to use key:* as a key, how this should work ?
escape it
@mgravell The hash works nicely if you are not already using a hash. But since you cannot nest hashes, it's not always applicable.
Surely by now people have realised that deleting multiple keys at once (something like del key:*) is incredibly useful, especially for devs like me that have to hunt down the same verbose LUA script every single time I want to delete a handful of keys while testing.
Is deleting multiple keys a feature that can be added? Redis has been around for a long enough time now, and I haven't seen anything on this when I've checked other than "it isn't possible".