CF.DEL
Syntax
CF.DEL key item
- Available in:
- Redis Open Source / Bloom 1.0.0
- Time complexity:
- O(k), where k is the number of sub-filters
- ACL categories:
-
@cuckoo,@write,@slow, - Compatibility:
- Redis Enterprise and Redis Cloud compatibility
Deletes an item once from the filter.
If the item exists only once, it will be removed from the filter. If the item was added multiple times, it will still be present.
Note:
Never use this command to delete an item unless you are certain you've added the item to the filter. Deleting an item you didn't previously add may corrupt the filter and cause false negatives.Required arguments
key
is key name for a cuckoo filter.
item
is an item to delete.
Complexity
O(n), where n is the number of sub-filters. Both alternative locations are
checked on all sub-filters.
Examples
redis> CF.INSERT cf ITEMS item1 item2 item2
1) (integer) 1
2) (integer) 1
3) (integer) 1
redis> CF.DEL cf item1
(integer) 1
redis> CF.DEL cf item1
(integer) 0
redis> CF.DEL cf item2
(integer) 1
redis> CF.DEL cf item2
(integer) 1
redis> CF.DEL cf item2
(integer) 0Redis Enterprise and Redis Cloud compatibility
| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Supported |
✅ Flexible & Annual ✅ Free & Fixed |
Return information
One of the following:
- Integer reply
1for successfully deleting an item, or0if no such item was found in the filter. - Simple error reply in these cases: invalid arguments or wrong key type.