Skip to content

Commit fbb54ac

Browse files
author
Simon Prickett
authored
Did some language clean up / clarification.
1 parent 8e22335 commit fbb54ac

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/commands/json.merge.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
Merge a given JSON value into matching paths. Consequently, JSON values at matching paths are updated, deleted, or expanded with new children.
22

3-
This command complies with [RFC7396](https://datatracker.ietf.org/doc/html/rfc7396) Json Merge Patch
3+
This command complies with [RFC7396](https://datatracker.ietf.org/doc/html/rfc7396) JSON Merge Patch
44

55
[Examples](#examples)
66

77
## Required arguments
88

99
<details open><summary><code>key</code></summary>
1010

11-
is key to merge into.
11+
is the key to merge into.
1212
</details>
1313

1414
<details open><summary><code>path</code></summary>
1515

16-
is JSONPath to specify. For non-existing keys the `path` must be `$`. For existing keys, for each matched `path`, the value that matches the `path` is being merged with the JSON `value`. For existing keys, when the path exists, except for the last element, a new child is added with the JSON `value`.
16+
is the JSONPath to specify where in the JSON document to apply the merge. For non-existing keys the `path` must be `$`. For existing keys, for each matched `path`, the value that matches the `path` is merged with the JSON `value`. For existing keys, when the path exists, except for the last element, a new child is added with the JSON `value`.
1717

1818
</details>
1919

2020
<details open><summary><code>value</code></summary>
2121

22-
is JSON value to merge with at the specified path. Merging is done according to the following rules per JSON value in the `value` argument while considering the corresponding original value if it exists:
22+
is the JSON value to merge with at the specified path. Merging is done according to the following rules per JSON value in the `value` argument while considering the corresponding original value if it exists:
2323
* merging an existing object key with a `null` value deletes the key
2424
* merging an existing object key with non-null value updates the value
25-
* merging a non-existing object key adds the key and value
26-
* merging an existing array with any merged value, replaces the entire array with the value
25+
* merging a nonexistent object key adds the key and value
26+
* merging an existing array with any merged value replaces the entire array with the value
2727
</details>
2828

2929
## Return value
3030

31-
JSET.MERGE returns a simple string reply: `OK` if executed correctly or `error` if fails to set the new values
31+
JSET.MERGE returns a simple string reply: `OK` if executed correctly or `error` if fails to set the new values.
3232

3333
For more information about replies, see [Redis serialization protocol specification](/docs/reference/protocol-spec).
3434

3535
## Examples
3636

37-
The JSON.MERGE provide four different behaviours to merge changes on a given key: create unexistent path, update an existing path with a new value, delete a existing path or replace an array with a new array
37+
The JSON.MERGE command provides four different behaviors to merge changes on a given key: create a new path, update an existing path with a new value, delete a existing path or replace an array with a new array.
3838

3939
<details open>
40-
<summary><b>Create a unexistent path-value</b></summary>
40+
<summary><b>Create a new path-value</b></summary>
4141

4242
{{< highlight bash >}}
4343
redis> JSON.SET doc $ '{"a":2}'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy