JSON.MERGE

Since 1.1.0JSON

Syntax

JSON.MERGE key path value
  • Flags: write
  • ACL categories: @json, @slow, @write
  • Arity: -2

Merges value into each value path matches, as an RFC 7396 merge patch: members are merged into objects, null deletes a member, and anything else replaces.

Reply

  • OK.

Examples

> JSON.SET d $ '{"addr":{"city":"London"},"email":"ada@x"}'
OK
> JSON.MERGE d $ '{"addr":{"zip":"N1"},"email":null}'
OK
> JSON.GET d
"{\"addr\":{\"city\":\"London\",\"zip\":\"N1\"}}"