Skip to content

Commit 3080ba1

Browse files
committed
WIP content/editorial changes (.json and .md)
1 parent c9da93b commit 3080ba1

File tree

8 files changed

+89
-21
lines changed

8 files changed

+89
-21
lines changed

commands.json

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,16 @@
104104
},
105105
{
106106
"name": "condition",
107-
"type": "enum",
108-
"enum": [
109-
"NX",
110-
"XX"
107+
"type": "oneof",
108+
"arguments": [
109+
{
110+
"name": "NX",
111+
"type": "pure-token"
112+
},
113+
{
114+
"name": "XX",
115+
"type": "pure-token"
116+
}
111117
],
112118
"optional": true
113119
}
@@ -152,6 +158,26 @@
152158
"since": "1.0.0",
153159
"group": "json"
154160
},
161+
"JSON.NUMMULTBY": {
162+
"summary": "Multiplies the numeric value at path by a value",
163+
"complexity": "O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key",
164+
"arguments": [
165+
{
166+
"name": "key",
167+
"type": "key"
168+
},
169+
{
170+
"name": "path",
171+
"type": "string"
172+
},
173+
{
174+
"name": "value",
175+
"type": "double"
176+
}
177+
],
178+
"since": "1.0.0",
179+
"group": "json"
180+
},
155181
"JSON.STRAPPEND": {
156182
"summary": "Appends a string to a JSON string value at path",
157183
"complexity": "O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key",
@@ -191,7 +217,7 @@
191217
"group": "json"
192218
},
193219
"JSON.ARRAPPEND": {
194-
"summary": "Appends JSON value(s) to the JSON array at path",
220+
"summary": "Append one or more json values into the array at path after the last element in it.",
195221
"complexity": "O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key",
196222
"arguments": [
197223
{
@@ -231,7 +257,7 @@
231257
{
232258
"type": "block",
233259
"optional": true,
234-
"block": [
260+
"arguments": [
235261
{
236262
"name": "start",
237263
"type": "integer"
@@ -283,7 +309,7 @@
283309
{
284310
"name": "path",
285311
"type": "string",
286-
"multiple": true
312+
"optioanl": true
287313
}
288314
],
289315
"since": "1.0.0",
@@ -300,7 +326,7 @@
300326
{
301327
"type": "block",
302328
"optional": true,
303-
"block": [
329+
"arguments": [
304330
{
305331
"name": "path",
306332
"type": "string"
@@ -407,5 +433,36 @@
407433
],
408434
"since": "1.0.0",
409435
"group": "json"
436+
},
437+
"JSON.DEBUG": {
438+
"summary": "Reports information",
439+
"complexity": "O(N) when path is evaluated to a single value, where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key",
440+
"arguments": [
441+
{
442+
"name": "subcommand",
443+
"type": "oneof",
444+
"arguments": [
445+
"MEMORY",
446+
"HELP"
447+
]
448+
},
449+
{
450+
"type": "block",
451+
"optional": true,
452+
"arguments": [
453+
{
454+
"name": "key",
455+
"type": "key"
456+
},
457+
{
458+
"name": "path",
459+
"type": "string",
460+
"optional": true
461+
}
462+
]
463+
}
464+
],
465+
"since": "1.0.0",
466+
"group": "json"
410467
}
411468
}

docs/commands/json.arrappend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Append the `json` values into the array at `path` after the last element in it.
44

55
@array-reply of @integer-reply - for each path, the array's new size, or @null-reply if the matching JSON value is not an array.
66

7-
#### Example
7+
@examples
88

99
```
1010
redis> JSON.SET doc $ '{"a":[1], "nested": {"a": [1,2]}, "nested2": {"a": 42}}'

docs/commands/json.debug-help.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Returns helpful information about the `JSON.DEBUG` command.
22

33
@return
44

5-
@array-reply
5+
@array-reply with helpful messages

docs/commands/json.numincrby.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Increments the number value stored at `path` by `number`.
22

33
@return
44

5-
@bulk-string-reply: the stringified new value for each path, or [null][6] if the matching JSON value is not a number.
5+
@bulk-string-reply: the stringified new value for each path, or @null-reply if the matching JSON value is not a number.
66

77
@examples
88

docs/commands/json.nummultby.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Multiplies the number value stored at `path` by `number`.
44

55
@bulk-string-reply - the stringified new values for each path, or @null-reply element if the matching JSON value is not a number.
66

7-
#### Example
7+
@examples
88

99
```
1010
redis> JSON.SET doc . '{"a":"b","b":[{"a":2}, {"a":5}, {"a":"c"}]}'

docs/commands/json.objlen.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,15 @@ Reports the number of keys in the JSON Object at `path` in `key`.
44

55
@return
66

7-
@integer-reply - the number of keys in the object.
7+
@array-reply of @integer-reply - for each path, the number of keys in the object, or @null-reply if the matching JSON value is not an object.
8+
9+
@examples
10+
11+
```
12+
redis> JSON.SET doc $ '{"a":[3], "nested": {"a": {"b":2, "c": 1}}}'
13+
OK
14+
redis> JSON.OBJLEN doc $..a
15+
1) (nil)
16+
2) (integer) 2
17+
```
18+

docs/commands/json.resp.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ Returns the JSON in `key` in [Redis Serialization Protocol (RESP)][5] form.
22

33
`path` defaults to root if not provided. This command uses the following mapping from JSON to RESP:
44

5-
* JSON Null maps to the [RESP Null Bulk String][5]
6-
* JSON `false` and `true` values map to [RESP Simple Strings][1]
7-
* JSON Numbers map to [RESP Integers][2] or [RESP Bulk Strings][3], depending on type
8-
* JSON Strings map to [RESP Bulk Strings][3]
9-
* JSON Arrays are represented as [RESP Arrays][4] in which the first element is the [simple string][1] `[` followed by the array's elements
10-
* JSON Objects are represented as [RESP Arrays][4] in which the first element is the [simple string][1] `{`. Each successive entry represents a key-value pair as a two-entry [array][4] of [bulk strings][3].
5+
* JSON Null maps to the @bulk-string-reply
6+
* JSON `false` and `true` values map to @simple-string-reply
7+
* JSON Numbers map to @integer-reply or @bulk-string-reply, depending on type
8+
* JSON Strings map to @bulk-string-reply
9+
* JSON Arrays are represented as @array-reply in which the first element is the @simple-string-reply `[` followed by the array's elements
10+
* JSON Objects are represented as @array-reply in which the first element is the @simple-string-reply `{`. Each successive entry represents a key-value pair as a two-entry @array-reply of @bulk-string-reply.
1111

1212
@return
1313

14-
[Array][4] - the JSON's RESP form as detailed.
14+
@array-reply - the JSON's RESP form as detailed.

docs/commands/json.type.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Reports the type of JSON value at `path`.
66

77
@array-reply of @string-reply - for each path, the value's type.
88

9-
#### Examples
9+
@examples
1010

1111
```
1212
redis> JSON.SET doc $ '{"a":2, "nested": {"a": true}, "foo": "bar"}'

0 commit comments

Comments
 (0)