PHPATHDEL

Usage:
PHPATHDEL key path [ WITHSUBPATHS ]
Complexity:
O(L + S) when deleting an exact path, where L is the path length and S is the number of fields in its payload. O(L + sum(P_i + F_i)) with WITHSUBPATHS, where P_i is the length of each matched path and F_i is the number of fields in its payload.
Since:
9.2.0
ACL Categories:
@pathhash, @write, @slow

Deletes the exact path and its fields. With WITHSUBPATHS, it also deletes every stored path that starts with the given bytes, even if the exact path is absent. An empty path with WITHSUBPATHS matches the entire Path Hash. Deleting the last stored path removes the key.

Use PHDEL to remove individual fields.

Reply#

Integer: the number of paths removed, or 0 if the key does not exist or no paths match.

Examples#

> PHMSET tree app FIELDS 1 host local app/api FIELDS 1 host api
OK
> PHPATHDEL tree app
(integer) 1
> PHPATHEXISTS tree app/api
(integer) 1
> PHPATHDEL tree app WITHSUBPATHS
(integer) 1
> EXISTS tree
(integer) 0