PHMSET

Usage:
PHMSET key path FIELDS numfields field value [ field value ... ] [ path FIELDS numfields field value [ field value ... ] ... ]
Complexity:
O(sum(L) + M*U), where M is the total number of fields across all path groups.
Since:
9.2.0
ACL Categories:
@pathhash, @write, @fast

Atomically sets fields at one or more exact paths. Each group consists of a path followed by FIELDS, a positive pair count, and that many field-value pairs. The entire argument list is validated before any writes are applied. The command creates missing keys and paths as needed. If a field at the same path appears more than once, the last assignment wins.

For a conditional write at one path, see PHSET.

Reply#

OK.

Examples#

> PHMSET tree app FIELDS 2 host local port 8080 app/api FIELDS 1 host api
OK
> PHMGET tree app FIELDS 2 host port app/api FIELDS 1 host
1) "local"
2) "8080"
3) "api"