diff --git a/mint.json b/mint.json index c6d8fd9f..8d147ffb 100644 --- a/mint.json +++ b/mint.json @@ -491,11 +491,14 @@ "redis/sdks/py/commands/json/del", "redis/sdks/py/commands/json/forget", "redis/sdks/py/commands/json/get", + "redis/sdks/py/commands/json/merge", "redis/sdks/py/commands/json/mget", + "redis/sdks/py/commands/json/mset", "redis/sdks/py/commands/json/numincrby", "redis/sdks/py/commands/json/nummultby", "redis/sdks/py/commands/json/objkeys", "redis/sdks/py/commands/json/objlen", + "redis/sdks/py/commands/json/resp", "redis/sdks/py/commands/json/set", "redis/sdks/py/commands/json/strappend", "redis/sdks/py/commands/json/strlen", diff --git a/redis/sdks/py/commands/json/arrappend.mdx b/redis/sdks/py/commands/json/arrappend.mdx index d900a5af..44b4c772 100644 --- a/redis/sdks/py/commands/json/arrappend.mdx +++ b/redis/sdks/py/commands/json/arrappend.mdx @@ -25,7 +25,7 @@ To specify a string as an array value to append, wrap the quoted string with an ## Response - + The length of the array after the appending. diff --git a/redis/sdks/py/commands/json/arrindex.mdx b/redis/sdks/py/commands/json/arrindex.mdx index dc596be0..0d30a444 100644 --- a/redis/sdks/py/commands/json/arrindex.mdx +++ b/redis/sdks/py/commands/json/arrindex.mdx @@ -8,7 +8,7 @@ description: Search for the first occurrence of a JSON value in an array. The key of the json entry. - + The path of the array. @@ -26,7 +26,7 @@ description: Search for the first occurrence of a JSON value in an array. ## Response - + The index of the first occurrence of the value in the array, or -1 if not found. diff --git a/redis/sdks/py/commands/json/arrinsert.mdx b/redis/sdks/py/commands/json/arrinsert.mdx index b16db7b0..8ebce6bb 100644 --- a/redis/sdks/py/commands/json/arrinsert.mdx +++ b/redis/sdks/py/commands/json/arrinsert.mdx @@ -8,7 +8,7 @@ description: Insert the json values into the array at path before the index (shi The key of the json entry. - + The path of the array. @@ -23,7 +23,7 @@ description: Insert the json values into the array at path before the index (shi ## Response - + The length of the array after the insertion. diff --git a/redis/sdks/py/commands/json/arrlen.mdx b/redis/sdks/py/commands/json/arrlen.mdx index 40ffe5fe..d1990ffb 100644 --- a/redis/sdks/py/commands/json/arrlen.mdx +++ b/redis/sdks/py/commands/json/arrlen.mdx @@ -15,7 +15,7 @@ description: Report the length of the JSON array at `path` in `key`. ## Response - + The length of the array. diff --git a/redis/sdks/py/commands/json/arrpop.mdx b/redis/sdks/py/commands/json/arrpop.mdx index fb566636..99e9fc63 100644 --- a/redis/sdks/py/commands/json/arrpop.mdx +++ b/redis/sdks/py/commands/json/arrpop.mdx @@ -8,7 +8,7 @@ description: Remove and return an element from the index in the array. By defaul The key of the json entry. - + The path of the array. @@ -21,16 +21,16 @@ description: Remove and return an element from the index in the array. By defaul ## Response - + The popped element or null if the array is empty. ```py Example -element = redis.json("key", "$.path.to.array") +element = redis.json.arrpop("key", "$.path.to.array") ``` ```py First -firstElement = redis.json("key", "$.path.to.array", 0) +firstElement = redis.json.arrpop("key", "$.path.to.array", 0) ``` diff --git a/redis/sdks/py/commands/json/arrtrim.mdx b/redis/sdks/py/commands/json/arrtrim.mdx index ed4213a8..41bce750 100644 --- a/redis/sdks/py/commands/json/arrtrim.mdx +++ b/redis/sdks/py/commands/json/arrtrim.mdx @@ -8,7 +8,7 @@ description: Trim an array so that it contains only the specified inclusive rang The key of the json entry. - + The path of the array. @@ -23,7 +23,7 @@ description: Trim an array so that it contains only the specified inclusive rang ## Response - + The length of the array after the trimming. diff --git a/redis/sdks/py/commands/json/clear.mdx b/redis/sdks/py/commands/json/clear.mdx index 2d1ebb14..3d155542 100644 --- a/redis/sdks/py/commands/json/clear.mdx +++ b/redis/sdks/py/commands/json/clear.mdx @@ -16,8 +16,8 @@ description: Clear container values (arrays/objects) and set numeric values to 0 ## Response - - The length of the array after the appending. + + How many keys cleared from the objects. diff --git a/redis/sdks/py/commands/json/del.mdx b/redis/sdks/py/commands/json/del.mdx index e5af0cd0..c2ce3fe2 100644 --- a/redis/sdks/py/commands/json/del.mdx +++ b/redis/sdks/py/commands/json/del.mdx @@ -13,12 +13,6 @@ description: Delete a key from a JSON document. - - - One or more values to append to the array. - - - ## Response diff --git a/redis/sdks/py/commands/json/forget.mdx b/redis/sdks/py/commands/json/forget.mdx index 267bb5d0..bd3cee82 100644 --- a/redis/sdks/py/commands/json/forget.mdx +++ b/redis/sdks/py/commands/json/forget.mdx @@ -13,12 +13,6 @@ description: Delete a key from a JSON document. - - - One or more values to append to the array. - - - ## Response diff --git a/redis/sdks/py/commands/json/get.mdx b/redis/sdks/py/commands/json/get.mdx index d470e2f2..1f979167 100644 --- a/redis/sdks/py/commands/json/get.mdx +++ b/redis/sdks/py/commands/json/get.mdx @@ -9,31 +9,13 @@ description: Get a single value from a JSON document. The key of the json entry. - - - - Sets the indentation string for nested levels. - - - - Sets the string that's printed at the end of each line. - - - - Sets the string that is put between a key and a value. - - - - - - One or more paths to retrieve from the JSON document. ## Response - + The value at the specified path or `null` if the path does not exist. @@ -42,12 +24,4 @@ description: Get a single value from a JSON document. value = redis.json.get("key", "$.path.to.somewhere") ``` -```py With Options -value = redis.json.get("key", { - indent: " ", - newline: "\n", - space: " ", -}, "$.path.to.somewhere") -``` - diff --git a/redis/sdks/py/commands/json/merge.mdx b/redis/sdks/py/commands/json/merge.mdx new file mode 100644 index 00000000..324d2c42 --- /dev/null +++ b/redis/sdks/py/commands/json/merge.mdx @@ -0,0 +1,32 @@ +--- +title: JSON.MERGE +description: Merges the JSON value at path in key with the provided value. +--- + +## Arguments + + + The key of the json entry. + + + The path of the value to set. + + + + + + The value to merge with. + + + +## Response + + + Returns true if the merge was successful. + + + +```py Example +redis.json.merge("key", "$.path.to.value", {"new": "value"}) +``` + diff --git a/redis/sdks/py/commands/json/mget.mdx b/redis/sdks/py/commands/json/mget.mdx index d8c86c73..8c8e50a1 100644 --- a/redis/sdks/py/commands/json/mget.mdx +++ b/redis/sdks/py/commands/json/mget.mdx @@ -5,17 +5,17 @@ description: Get the same path from multiple JSON documents. ## Arguments - + One or more keys of JSON documents. - + The path to get from the JSON document. ## Response - + The values at the specified path or `null` if the path does not exist. diff --git a/redis/sdks/py/commands/json/mset.mdx b/redis/sdks/py/commands/json/mset.mdx new file mode 100644 index 00000000..a6d6a30a --- /dev/null +++ b/redis/sdks/py/commands/json/mset.mdx @@ -0,0 +1,22 @@ +--- +title: JSON.MSET +description: Sets multiple JSON values at multiple paths in multiple keys. +--- + +## Arguments + + + A list of tuples where each tuple contains a key, a path, and a value. + + +## Response + + + Returns true if the operation was successful. + + + +```py Example +redis.json.set([(key, "$.path", value), (key2, "$.path2", value2)]) +``` + diff --git a/redis/sdks/py/commands/json/numincrby.mdx b/redis/sdks/py/commands/json/numincrby.mdx index d72bbc93..e7d73147 100644 --- a/redis/sdks/py/commands/json/numincrby.mdx +++ b/redis/sdks/py/commands/json/numincrby.mdx @@ -8,8 +8,8 @@ description: Increment the number value stored at `path` by number. The key of the json entry. - - The path of the array. + + The path of the number. @@ -22,12 +22,12 @@ description: Increment the number value stored at `path` by number. ## Response - + The new value after incrementing ```py Example -newValue = redis.json.numincrby("key", "$.path.to.array", 2) +newValue = redis.json.numincrby("key", "$.path.to.value", 2) ``` diff --git a/redis/sdks/py/commands/json/nummultby.mdx b/redis/sdks/py/commands/json/nummultby.mdx index 2437f53c..6581a483 100644 --- a/redis/sdks/py/commands/json/nummultby.mdx +++ b/redis/sdks/py/commands/json/nummultby.mdx @@ -8,8 +8,8 @@ description: Multiply the number value stored at `path` by number. The key of the json entry. - - The path of the array. + + The path of the number. @@ -22,12 +22,12 @@ description: Multiply the number value stored at `path` by number. ## Response - + The new value after multiplying ```py Example -newValue = redis.json.nummultby("key", "$.path.to.array", 2) +newValue = redis.json.nummultby("key", "$.path.to.value", 2) ``` diff --git a/redis/sdks/py/commands/json/objkeys.mdx b/redis/sdks/py/commands/json/objkeys.mdx index a1fe5cbf..ce879c27 100644 --- a/redis/sdks/py/commands/json/objkeys.mdx +++ b/redis/sdks/py/commands/json/objkeys.mdx @@ -9,14 +9,14 @@ description: Return the keys in the object that`s referenced by path. The key of the json entry. - The path of the array. + The path of the object. ## Response - + The keys of the object at the path. diff --git a/redis/sdks/py/commands/json/objlen.mdx b/redis/sdks/py/commands/json/objlen.mdx index a525f893..da4f70aa 100644 --- a/redis/sdks/py/commands/json/objlen.mdx +++ b/redis/sdks/py/commands/json/objlen.mdx @@ -9,15 +9,15 @@ description: Report the number of keys in the JSON object at `path` in `key`. The key of the json entry. - The path of the array. + The path of the object. ## Response - - The number of in the objects. + + The number of keys in the objects. diff --git a/redis/sdks/py/commands/json/resp.mdx b/redis/sdks/py/commands/json/resp.mdx new file mode 100644 index 00000000..9f30f978 --- /dev/null +++ b/redis/sdks/py/commands/json/resp.mdx @@ -0,0 +1,27 @@ +--- +title: JSON.RESP +description: Return the value at the path in Redis serialization protocol format. +--- + +## Arguments + + + The key of the json entry. + + + The path of the object. + + + + +## Response + + + Return the value at the path in Redis serialization protocol format. + + + +```py Example +resp = redis.json.resp("key", "$.path") +``` + diff --git a/redis/sdks/py/commands/json/set.mdx b/redis/sdks/py/commands/json/set.mdx index ea615a42..8dea33fa 100644 --- a/redis/sdks/py/commands/json/set.mdx +++ b/redis/sdks/py/commands/json/set.mdx @@ -8,8 +8,8 @@ description: Set the JSON value at path in key. The key of the json entry. - - The path of the array. + + The path of the value to set. @@ -18,25 +18,32 @@ description: Set the JSON value at path in key. The value to set. + + Sets the value at path only if it does not exist. + + + + Sets the value at path only if it does exist. + + ## Response - -`OK` + + Returns true if the value was set. ```py Example -Set the JSON value at path in key. redis.json.set(key, "$.path", value) ``` ```py NX value = ... -redis.json.set(key, "$.path", value, { nx:true }) +redis.json.set(key, "$.path", value, nx=true) ``` ```py XX value = ... -redis.json.set(key, "$.path", value, { xx:true }) +redis.json.set(key, "$.path", value, xx=true) ``` diff --git a/redis/sdks/py/commands/json/strappend.mdx b/redis/sdks/py/commands/json/strappend.mdx index d6e3a380..5df526e9 100644 --- a/redis/sdks/py/commands/json/strappend.mdx +++ b/redis/sdks/py/commands/json/strappend.mdx @@ -8,8 +8,8 @@ description: Append the json-string values to the string at path. The key of the json entry. - - The path of the value. + + The path of the string. @@ -21,12 +21,12 @@ description: Append the json-string values to the string at path. ## Response - - The length of the array after the appending. + + The length of the string after the appending. ```py Example -redis.json.strappend("key", "$.path.to.array", "abc") +redis.json.strappend("key", "$.path.to.str", "abc") ``` diff --git a/redis/sdks/py/commands/json/strlen.mdx b/redis/sdks/py/commands/json/strlen.mdx index a5f79e00..a1596365 100644 --- a/redis/sdks/py/commands/json/strlen.mdx +++ b/redis/sdks/py/commands/json/strlen.mdx @@ -9,24 +9,18 @@ description: Report the length of the JSON String at path in key The key of the json entry. - The path of the array. - - - - - - One or more values to append to the array. + The path of the string. ## Response - - The length of the array after the appending. + + The length of the string at the path. ```py Example -redis.json("key", "$.path.to.array", "a") +redis.json.strlen("key", "$.path.to.str") ``` diff --git a/redis/sdks/py/commands/json/toggle.mdx b/redis/sdks/py/commands/json/toggle.mdx index 60fb48e7..f79dd4a8 100644 --- a/redis/sdks/py/commands/json/toggle.mdx +++ b/redis/sdks/py/commands/json/toggle.mdx @@ -17,12 +17,12 @@ description: Toggle a boolean value stored at `path`. ## Response - + The new value of the boolean. ```py Example -bool = redis.json.toggle("key", "$.path.to.array") +bool = redis.json.toggle("key", "$.path.to.bool") ``` diff --git a/redis/sdks/py/commands/json/type.mdx b/redis/sdks/py/commands/json/type.mdx index 6aa7ecd4..20014236 100644 --- a/redis/sdks/py/commands/json/type.mdx +++ b/redis/sdks/py/commands/json/type.mdx @@ -17,7 +17,7 @@ description: Report the type of JSON value at `path`. ## Response - + The type of the value at `path` or `null` if the value does not exist. diff --git a/redis/sdks/ts/commands/json/arrappend.mdx b/redis/sdks/ts/commands/json/arrappend.mdx index 4508a205..d996f4a5 100644 --- a/redis/sdks/ts/commands/json/arrappend.mdx +++ b/redis/sdks/ts/commands/json/arrappend.mdx @@ -24,7 +24,7 @@ To specify a string as an array value to append, wrap the quoted string with an ## Response - + The length of the array after the appending. diff --git a/redis/sdks/ts/commands/json/arrindex.mdx b/redis/sdks/ts/commands/json/arrindex.mdx index 66f0f22d..05e90b23 100644 --- a/redis/sdks/ts/commands/json/arrindex.mdx +++ b/redis/sdks/ts/commands/json/arrindex.mdx @@ -26,7 +26,7 @@ description: Search for the first occurrence of a JSON value in an array. ## Response - + The index of the first occurrence of the value in the array, or -1 if not found. diff --git a/redis/sdks/ts/commands/json/arrinsert.mdx b/redis/sdks/ts/commands/json/arrinsert.mdx index 0773d30a..88a6336b 100644 --- a/redis/sdks/ts/commands/json/arrinsert.mdx +++ b/redis/sdks/ts/commands/json/arrinsert.mdx @@ -23,7 +23,7 @@ description: Insert the json values into the array at path before the index (shi ## Response - + The length of the array after the insertion. diff --git a/redis/sdks/ts/commands/json/arrlen.mdx b/redis/sdks/ts/commands/json/arrlen.mdx index 2e73b4ad..987ad5e5 100644 --- a/redis/sdks/ts/commands/json/arrlen.mdx +++ b/redis/sdks/ts/commands/json/arrlen.mdx @@ -15,7 +15,7 @@ description: Report the length of the JSON array at `path` in `key`. ## Response - + The length of the array. diff --git a/redis/sdks/ts/commands/json/arrpop.mdx b/redis/sdks/ts/commands/json/arrpop.mdx index 87acb7ac..c5a85efb 100644 --- a/redis/sdks/ts/commands/json/arrpop.mdx +++ b/redis/sdks/ts/commands/json/arrpop.mdx @@ -21,16 +21,16 @@ description: Remove and return an element from the index in the array. By defaul ## Response - + The popped element or null if the array is empty. ```ts Example -const element = await redis.json("key", "$.path.to.array"); +const element = await redis.json.arrpop("key", "$.path.to.array"); ``` ```ts First -const firstElement = await redis.json("key", "$.path.to.array", 0); +const firstElement = await redis.json.arrpop("key", "$.path.to.array", 0); ``` diff --git a/redis/sdks/ts/commands/json/arrtrim.mdx b/redis/sdks/ts/commands/json/arrtrim.mdx index 2b45124c..78865f38 100644 --- a/redis/sdks/ts/commands/json/arrtrim.mdx +++ b/redis/sdks/ts/commands/json/arrtrim.mdx @@ -23,7 +23,7 @@ description: Trim an array so that it contains only the specified inclusive rang ## Response - + The length of the array after the trimming. diff --git a/redis/sdks/ts/commands/json/clear.mdx b/redis/sdks/ts/commands/json/clear.mdx index d91ee816..a2386a25 100644 --- a/redis/sdks/ts/commands/json/clear.mdx +++ b/redis/sdks/ts/commands/json/clear.mdx @@ -16,8 +16,8 @@ description: Clear container values (arrays/objects) and set numeric values to 0 ## Response - - The length of the array after the appending. + + How many values were cleared. diff --git a/redis/sdks/ts/commands/json/del.mdx b/redis/sdks/ts/commands/json/del.mdx index 3f8715ce..bbab602c 100644 --- a/redis/sdks/ts/commands/json/del.mdx +++ b/redis/sdks/ts/commands/json/del.mdx @@ -13,12 +13,6 @@ description: Delete a key from a JSON document. - - - One or more values to append to the array. - - - ## Response diff --git a/redis/sdks/ts/commands/json/forget.mdx b/redis/sdks/ts/commands/json/forget.mdx index 84a4a2dc..e6fdee04 100644 --- a/redis/sdks/ts/commands/json/forget.mdx +++ b/redis/sdks/ts/commands/json/forget.mdx @@ -13,12 +13,6 @@ description: Delete a key from a JSON document. - - - One or more values to append to the array. - - - ## Response diff --git a/redis/sdks/ts/commands/json/get.mdx b/redis/sdks/ts/commands/json/get.mdx index 57094f78..bdeb2615 100644 --- a/redis/sdks/ts/commands/json/get.mdx +++ b/redis/sdks/ts/commands/json/get.mdx @@ -33,7 +33,7 @@ description: Get a single value from a JSON document. ## Response - + The value at the specified path or `null` if the path does not exist. diff --git a/redis/sdks/ts/commands/json/numincrby.mdx b/redis/sdks/ts/commands/json/numincrby.mdx index f256dce2..8007e1b5 100644 --- a/redis/sdks/ts/commands/json/numincrby.mdx +++ b/redis/sdks/ts/commands/json/numincrby.mdx @@ -22,12 +22,12 @@ description: Increment the number value stored at `path` by number. ## Response - + The new value after incrementing ```ts Example -const newValue = await redis.json.numincrby("key", "$.path.to.array", 2); +const newValue = await redis.json.numincrby("key", "$.path.to.value", 2); ``` diff --git a/redis/sdks/ts/commands/json/nummultby.mdx b/redis/sdks/ts/commands/json/nummultby.mdx index 74f0fe7f..cc42c9bf 100644 --- a/redis/sdks/ts/commands/json/nummultby.mdx +++ b/redis/sdks/ts/commands/json/nummultby.mdx @@ -22,12 +22,12 @@ description: Multiply the number value stored at `path` by number. ## Response - + The new value after multiplying ```ts Example -const newValue = await redis.json.nummultby("key", "$.path.to.array", 2); +const newValue = await redis.json.nummultby("key", "$.path.to.value", 2); ``` diff --git a/redis/sdks/ts/commands/json/objkeys.mdx b/redis/sdks/ts/commands/json/objkeys.mdx index b95bc27f..72aa5f6e 100644 --- a/redis/sdks/ts/commands/json/objkeys.mdx +++ b/redis/sdks/ts/commands/json/objkeys.mdx @@ -16,7 +16,7 @@ description: Return the keys in the object that`s referenced by path. ## Response - + The keys of the object at the path. diff --git a/redis/sdks/ts/commands/json/objlen.mdx b/redis/sdks/ts/commands/json/objlen.mdx index df29a340..907200bc 100644 --- a/redis/sdks/ts/commands/json/objlen.mdx +++ b/redis/sdks/ts/commands/json/objlen.mdx @@ -9,7 +9,7 @@ description: Report the number of keys in the JSON object at `path` in `key`. The key of the json entry. - The path of the array. + The path of the object. @@ -17,7 +17,7 @@ description: Report the number of keys in the JSON object at `path` in `key`. ## Response - The number of in the objects. + The number of keys in the objects. diff --git a/redis/sdks/ts/commands/json/set.mdx b/redis/sdks/ts/commands/json/set.mdx index fd921c78..830e535f 100644 --- a/redis/sdks/ts/commands/json/set.mdx +++ b/redis/sdks/ts/commands/json/set.mdx @@ -9,7 +9,7 @@ description: Set the JSON value at path in key. The key of the json entry. - The path of the array. + The path of the value to set. diff --git a/redis/sdks/ts/commands/json/strappend.mdx b/redis/sdks/ts/commands/json/strappend.mdx index 9e94fbd6..78da38b7 100644 --- a/redis/sdks/ts/commands/json/strappend.mdx +++ b/redis/sdks/ts/commands/json/strappend.mdx @@ -21,12 +21,12 @@ description: Append the json-string values to the string at path. ## Response - + The length of the array after the appending. ```ts Example -await redis.json.strappend("key", "$.path.to.array", "abc"); +await redis.json.strappend("key", "$.path.to.str", "abc"); ``` diff --git a/redis/sdks/ts/commands/json/strlen.mdx b/redis/sdks/ts/commands/json/strlen.mdx index 54534d25..71df769c 100644 --- a/redis/sdks/ts/commands/json/strlen.mdx +++ b/redis/sdks/ts/commands/json/strlen.mdx @@ -21,6 +21,6 @@ description: Report the length of the JSON String at path in key ```ts Example -await redis.json("key", "$.path.to.array", "a"); +await redis.json.strlen("key", "$.path.to.str", "a"); ``` diff --git a/redis/sdks/ts/commands/json/toggle.mdx b/redis/sdks/ts/commands/json/toggle.mdx index 920fb703..3c0e38cc 100644 --- a/redis/sdks/ts/commands/json/toggle.mdx +++ b/redis/sdks/ts/commands/json/toggle.mdx @@ -23,6 +23,6 @@ description: Toggle a boolean value stored at `path`. ```ts Example -const bool = await redis.json.toggle("key", "$.path.to.array"); +const bool = await redis.json.toggle("key", "$.path.to.bool"); ``` diff --git a/redis/sdks/ts/commands/json/type.mdx b/redis/sdks/ts/commands/json/type.mdx index 3618cbd4..f5dfd1a6 100644 --- a/redis/sdks/ts/commands/json/type.mdx +++ b/redis/sdks/ts/commands/json/type.mdx @@ -17,7 +17,7 @@ description: Report the type of JSON value at `path`. ## Response - + The type of the value at `path` or `null` if the value does not exist.