PHDEL

Usage:
PHDEL key path [ field ] [ [ field ] ... ]
Complexity:
O(L + F*U) when deleting specified fields, where L is the path length, F is the number of requested fields, and U is the payload field lookup cost. O(L + S) when deleting the complete payload, where S is the number of stored fields in the payload.
Since:
9.2.0
ACL Categories:
@pathhash, @write, @slow

Deletes the specified fields at the exact path. Missing fields are ignored. If no fields are specified, the command deletes the whole path and its field map. Deleting the last field removes the path. In either form, deleting the last path also removes the key.

To delete an exact path or a whole subtree, see PHPATHDEL.

Reply#

Integer: With field arguments, the reply is the number of fields removed. Without field arguments, it is 1 if the path was removed or 0 otherwise. A missing key or path returns 0 in both forms.

Examples#

> PHSET tree app FIELDS 2 host local port 8080
OK
> PHDEL tree app host missing
(integer) 1
> PHDEL tree app
(integer) 1
> EXISTS tree
(integer) 0