-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow deletion of multiple keys #37
Comments
Hey 👋 ! Totally agree, this feature request makes a lot of sense, will try to work on it as soon as I can! Thanks! |
Hey 👋 ! Sorry for the lateness, but finally I've pushed some changes to address this feature to allow removing multiple keys at once. For example: MyApp.RedisCache.delete_all({:in, ["foo", "bar"]}) Now the adapter supports the queue predefined query This operation is internally optimized to do it in one command for the Please try it out and let me know your thoughts, stay tuned! |
The use case: I want to delete all key that matches "prefix*". Nebulex gives us
Nebulex.Cache.delete_all
, but that doesn't work as redis has no native methods to delete all matching keys, so right now this method only works if we sendnil
to delete the whole thing.So, the best way to do this in redis to get all matching keys then delete them in a single DEL call sending a list of keys. Getting all matching keys can be done using
Nebulex.Cache.all
but there's no way to delete multiple keys at once, forcing us to do multiple callstl,dr: Please implement
Nebulex.Cache.delete
in a way we can send a list of keys to be deletedThe text was updated successfully, but these errors were encountered: