Skip to content

Commit 9430e49

Browse files
committed
Add front matter to commands .md files + missing examples
1 parent da4fba5 commit 9430e49

22 files changed

+225
-0
lines changed

docs/commands/json.arrappend.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: "JSON.ARRAPPEND command"
3+
linkTitle: "JSON.ARRAPPEND"
4+
type: docs
5+
weight: 1
6+
description: >
7+
"detailed description"
8+
---
9+
110
Append the `json` values into the array at `path` after the last element in it.
211

312
@return

docs/commands/json.arrindex.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: "JSON.ARRINDEX command"
3+
linkTitle: "JSON.ARRINDEX"
4+
type: docs
5+
weight: 1
6+
description: >
7+
"detailed description"
8+
---
9+
110
Searches for the first occurrence of a scalar JSON value in an array.
211

312
The optional inclusive `start` (default 0) and exclusive `stop` (default 0, meaning that the last element is included) specify a slice of the array to search.

docs/commands/json.arrinsert.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: "JSON.ARRINSERT command"
3+
linkTitle: "JSON.ARRINSERT"
4+
type: docs
5+
weight: 1
6+
description: >
7+
"detailed description"
8+
---
9+
110
Inserts the `json` values into the array at `path` before the `index` (shifts to the right).
211

312
The index must be in the array's range. Inserting at `index` 0 prepends to the array. Negative index values start from the end of the array.

docs/commands/json.arrlen.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2+
---
3+
title: "JSON.ARRLEN command"
4+
linkTitle: "JSON.ARRLEN"
5+
type: docs
6+
weight: 1
7+
description: >
8+
"detailed description"
9+
---
10+
111
Reports the length of the JSON Array at `path` in `key`.
212

313
`path` defaults to root if not provided. Returns null if the `key` or `path` do not exist.

docs/commands/json.arrpop.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: "JSON.ARRPOP command"
3+
linkTitle: "JSON.ARRPOP"
4+
type: docs
5+
weight: 1
6+
description: >
7+
"detailed description"
8+
---
9+
110
Removes and returns an element from the index in the array.
211

312
`path` defaults to root if not provided. `index` is the position in the array to start popping from (defaults to -1, meaning the last element). Out-of-range indexes round to their respective array ends. Popping an empty array returns null.

docs/commands/json.arrtrim.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: "JSON.ARRTRIM command"
3+
linkTitle: "JSON.ARRTRIM"
4+
type: docs
5+
weight: 1
6+
description: >
7+
"detailed description"
8+
---
9+
110
Trims an array so that it contains only the specified inclusive range of elements.
211

312
This command is extremely forgiving and using it with out-of-range indexes will not produce an error. There are a few differences between how RedisJSON v2.0 and legacy versions handle out-of-range indexes.

docs/commands/json.clear.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: "JSON.CLEAR command"
3+
linkTitle: "JSON.CLEAR"
4+
type: docs
5+
weight: 1
6+
description: >
7+
"detailed description"
8+
---
9+
110
Clears container values (Arrays/Objects), sets numeric values to `0`, sets string value to emptys, and sets boolean values to `false`.
211

312
Already cleared values are ignored: empty containers, zero numbers, empty strings, `false`, and `null`.
@@ -7,3 +16,14 @@ Already cleared values are ignored: empty containers, zero numbers, empty string
716
@return
817

918
@integer-reply: specifically the number of values cleared.
19+
20+
@examples
21+
22+
```
23+
redis> JSON.SET doc $ '{"obj":{"a":1, "b":2}, "arr":[1,2,3], "str": "foo", "bool": true, "int": 42, "float": 3.14}'
24+
OK
25+
redis> JSON.CLEAR doc $.*
26+
(integer) 6
27+
redis> JSON.GET doc $
28+
"[{\"obj\":{},\"arr\":[],\"str\":\"\",\"bool\":false,\"int\":0,\"float\":0}]"
29+
```

docs/commands/json.debug-help.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: "JSON.DEBUG HELP subcommand"
3+
linkTitle: "JSON.DEBUG HELP"
4+
type: docs
5+
weight: 1
6+
description: >
7+
"detailed description"
8+
---
9+
110
Returns helpful information about the `JSON.DEBUG` command.
211

312
@return

docs/commands/json.debug-memory.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: "JSON.DEBUG MEMORY subcommand"
3+
linkTitle: "JSON.DEBUG MEMORY"
4+
type: docs
5+
weight: 1
6+
description: >
7+
"detailed description"
8+
---
9+
110
Report a value's memory usage in bytes. `path` defaults to root if not provided.
211

312
@return

docs/commands/json.del.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: "JSON.DEL command"
3+
linkTitle: "JSON.DEL"
4+
type: docs
5+
weight: 1
6+
description: >
7+
"detailed description"
8+
---
9+
110
Deletes a value.
211

312
`path` defaults to root if not provided. Ignores nonexistent keys and paths. Deleting an object's root is equivalent to deleting the key from Redis.

0 commit comments

Comments
 (0)