Class Json


  • public class Json
    extends java.lang.Object
    Module for JSON commands.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrappend​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path, @NonNull GlideString[] values)
      Appends one or more values to the JSON array at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrappend​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path, @NonNull java.lang.String[] values)
      Appends one or more values to the JSON array at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrindex​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path, @NonNull GlideString scalar)
      Searches for the first occurrence of a scalar JSON value in the arrays at the path.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrindex​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path, @NonNull GlideString scalar, @NonNull JsonArrindexOptions options)
      Searches for the first occurrence of a scalar JSON value in the arrays at the path.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrindex​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path, @NonNull java.lang.String scalar)
      Searches for the first occurrence of a scalar JSON value in the arrays at the path.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrindex​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path, @NonNull java.lang.String scalar, @NonNull JsonArrindexOptions options)
      Searches for the first occurrence of a scalar JSON value in the arrays at the path.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrinsert​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path, int index, @NonNull GlideString[] values)
      Inserts one or more values into the array at the specified path within the JSON document stored at key, before the given index.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrinsert​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path, int index, @NonNull java.lang.String[] values)
      Inserts one or more values into the array at the specified path within the JSON document stored at key, before the given index.
      static java.util.concurrent.CompletableFuture<java.lang.Long> arrlen​(@NonNull BaseClient client, @NonNull GlideString key)
      Retrieves the length of the array at the root of the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrlen​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Retrieves the length of the array at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> arrlen​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Retrieves the length of the array at the root of the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrlen​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Retrieves the length of the array at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<GlideString> arrpop​(@NonNull BaseClient client, @NonNull GlideString key)
      Pops the last element from the array located in the root of the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrpop​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Pops the last element from the array located at path in the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrpop​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path, long index)
      Pops an element from the array located at path in the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> arrpop​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Pops the last element from the array stored in the root of the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrpop​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Pops the last element from the array located at path in the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrpop​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path, long index)
      Pops an element from the array located at path in the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrtrim​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path, int start, int end)
      Trims an array at the specified path within the JSON document stored at key so that it becomes a subarray [start, end], both inclusive.
      static java.util.concurrent.CompletableFuture<java.lang.Object> arrtrim​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path, int start, int end)
      Trims an array at the specified path within the JSON document stored at key so that it becomes a subarray [start, end], both inclusive.
      static java.util.concurrent.CompletableFuture<java.lang.Long> clear​(@NonNull BaseClient client, @NonNull GlideString key)
      Clears an array and an object at the root of the JSON document stored at key.
      Equivalent to clear(BaseClient, GlideString, GlideString) with path set to ".".
      static java.util.concurrent.CompletableFuture<java.lang.Long> clear​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Clears arrays and objects at the specified path within the JSON document stored at key.
      Numeric values are set to 0, boolean values are set to false, and string values are converted to empty strings.
      static java.util.concurrent.CompletableFuture<java.lang.Long> clear​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Clears an array and an object at the root of the JSON document stored at key.
      Equivalent to clear(BaseClient, String, String) with path set to ".".
      static java.util.concurrent.CompletableFuture<java.lang.Long> clear​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Clears arrays and objects at the specified path within the JSON document stored at key.
      Numeric values are set to 0, boolean values are set to false, and string values are converted to empty strings.
      static java.util.concurrent.CompletableFuture<java.lang.Long> debugFields​(@NonNull BaseClient client, @NonNull GlideString key)
      Reports the number of fields at the specified path within the JSON document stored at key.
      Each non-container JSON value counts as one field.
      static java.util.concurrent.CompletableFuture<java.lang.Object> debugFields​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Reports the number of fields at the specified path within the JSON document stored at key.
      Each non-container JSON value counts as one field.
      static java.util.concurrent.CompletableFuture<java.lang.Long> debugFields​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Reports the number of fields at the specified path within the JSON document stored at key.
      Each non-container JSON value counts as one field.
      static java.util.concurrent.CompletableFuture<java.lang.Object> debugFields​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Reports the number of fields at the specified path within the JSON document stored at key.
      Each non-container JSON value counts as one field.
      static java.util.concurrent.CompletableFuture<java.lang.Long> debugMemory​(@NonNull BaseClient client, @NonNull GlideString key)
      Reports memory usage in bytes of a JSON object at the specified path within the JSON document stored at key.
      Equivalent to debugMemory(BaseClient, GlideString, GlideString) with path set to gs("..").
      static java.util.concurrent.CompletableFuture<java.lang.Object> debugMemory​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Reports memory usage in bytes of a JSON object at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> debugMemory​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Reports memory usage in bytes of a JSON object at the specified path within the JSON document stored at key.
      Equivalent to debugMemory(BaseClient, String, String) with path set to "..".
      static java.util.concurrent.CompletableFuture<java.lang.Object> debugMemory​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Reports memory usage in bytes of a JSON object at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> del​(@NonNull BaseClient client, @NonNull GlideString key)
      Deletes the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> del​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Deletes the JSON value at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> del​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Deletes the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> del​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Deletes the JSON value at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> forget​(@NonNull BaseClient client, @NonNull GlideString key)
      Deletes the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> forget​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Deletes the JSON value at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> forget​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Deletes the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> forget​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Deletes the JSON value at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<GlideString> get​(@NonNull BaseClient client, @NonNull GlideString key)
      Retrieves the JSON value at the specified path stored at key.
      static java.util.concurrent.CompletableFuture<GlideString> get​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull JsonGetOptionsBinary options)
      Retrieves the JSON value at the specified path stored at key.
      static java.util.concurrent.CompletableFuture<GlideString> get​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString[] paths)
      Retrieves the JSON value at the specified paths stored at key.
      static java.util.concurrent.CompletableFuture<GlideString> get​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString[] paths, @NonNull JsonGetOptionsBinary options)
      Retrieves the JSON value at the specified path stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> get​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Retrieves the JSON value at the specified path stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> get​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull JsonGetOptions options)
      Retrieves the JSON value at the specified path stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> get​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String[] paths)
      Retrieves the JSON value at the specified paths stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> get​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String[] paths, @NonNull JsonGetOptions options)
      Retrieves the JSON value at the specified path stored at key.
      static java.util.concurrent.CompletableFuture<GlideString[]> mget​(@NonNull BaseClient client, @NonNull GlideString[] keys, @NonNull GlideString path)
      Retrieves the JSON values at the specified path stored at multiple keys .
      static java.util.concurrent.CompletableFuture<java.lang.String[]> mget​(@NonNull BaseClient client, @NonNull java.lang.String[] keys, @NonNull java.lang.String path)
      Retrieves the JSON values at the specified path stored at multiple keys .
      static java.util.concurrent.CompletableFuture<GlideString> numincrby​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path, java.lang.Number number)
      Increments or decrements the JSON value(s) at the specified path by number within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> numincrby​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path, java.lang.Number number)
      Increments or decrements the JSON value(s) at the specified path by number within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<GlideString> nummultby​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path, java.lang.Number number)
      Multiplies the JSON value(s) at the specified path by number within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> nummultby​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path, java.lang.Number number)
      Multiplies the JSON value(s) at the specified path by number within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object[]> objkeys​(@NonNull BaseClient client, @NonNull GlideString key)
      Retrieves the key names in the object values at the specified path within the JSON document stored at key.
      Equivalent to objkeys(BaseClient, GlideString, GlideString) with path set to gs(".").
      static java.util.concurrent.CompletableFuture<java.lang.Object[]> objkeys​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Retrieves the key names in the object values at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object[]> objkeys​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Retrieves the key names in the object values at the specified path within the JSON document stored at key.
      Equivalent to objkeys(BaseClient, String, String) with path set to ".".
      static java.util.concurrent.CompletableFuture<java.lang.Object[]> objkeys​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Retrieves the key names in the object values at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> objlen​(@NonNull BaseClient client, @NonNull GlideString key)
      Retrieves the number of key-value pairs in the object values at the specified path within the JSON document stored at key.
      Equivalent to objlen(BaseClient, GlideString, GlideString) with path set to gs(".").
      static java.util.concurrent.CompletableFuture<java.lang.Object> objlen​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Retrieves the number of key-value pairs in the object values at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> objlen​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Retrieves the number of key-value pairs in the object values at the specified path within the JSON document stored at key.
      Equivalent to objlen(BaseClient, String, String) with path set to ".".
      static java.util.concurrent.CompletableFuture<java.lang.Object> objlen​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Retrieves the number of key-value pairs in the object values at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> resp​(@NonNull BaseClient client, @NonNull GlideString key)
      Retrieves the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> resp​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Retrieve the JSON value at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> resp​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Retrieves the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> resp​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Retrieve the JSON value at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> set​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path, @NonNull GlideString value)
      Sets the JSON value at the specified path stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> set​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path, @NonNull GlideString value, @NonNull ConditionalChange setCondition)
      Sets the JSON value at the specified path stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> set​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path, @NonNull java.lang.String value)
      Sets the JSON value at the specified path stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.String> set​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path, @NonNull java.lang.String value, @NonNull ConditionalChange setCondition)
      Sets the JSON value at the specified path stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> strappend​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString value)
      Appends the specified value to the string stored at the root within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> strappend​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString value, @NonNull GlideString path)
      Appends the specified value to the string stored at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> strappend​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String value)
      Appends the specified value to the string stored at the root within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> strappend​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String value, @NonNull java.lang.String path)
      Appends the specified value to the string stored at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> strlen​(@NonNull BaseClient client, @NonNull GlideString key)
      Returns the length of the JSON string value stored at the root within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> strlen​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Returns the length of the JSON string value stored at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Long> strlen​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Returns the length of the JSON string value stored at the root within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> strlen​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Returns the length of the JSON string value stored at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Boolean> toggle​(@NonNull BaseClient client, @NonNull GlideString key)
      Toggles a Boolean value stored at the root within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> toggle​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Toggles a Boolean value stored at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Boolean> toggle​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Toggles a Boolean value stored at the root within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> toggle​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Toggles a Boolean value stored at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> type​(@NonNull BaseClient client, @NonNull GlideString key)
      Retrieves the type of the JSON value at the root of the JSON document stored at key .
      static java.util.concurrent.CompletableFuture<java.lang.Object> type​(@NonNull BaseClient client, @NonNull GlideString key, @NonNull GlideString path)
      Retrieves the type of the JSON value at the specified path within the JSON document stored at key.
      static java.util.concurrent.CompletableFuture<java.lang.Object> type​(@NonNull BaseClient client, @NonNull java.lang.String key)
      Retrieves the type of the JSON value at the root of the JSON document stored at key .
      static java.util.concurrent.CompletableFuture<java.lang.Object> type​(@NonNull BaseClient client, @NonNull java.lang.String key, @NonNull java.lang.String path)
      Retrieves the type of the JSON value at the specified path within the JSON document stored at key.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • set

        public static java.util.concurrent.CompletableFuture<java.lang.String> set​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String key,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String path,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String value)
        Sets the JSON value at the specified path stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the value will be set. The key will be modified only if value is added as the last child in the specified path, or if the specified path acts as the parent of a new child being added.
        value - The value to set at the specific path, in JSON formatted string.
        Returns:
        A simple "OK" response if the value is successfully set.
        Example:
        
         String value = Json.set(client, "doc", ".", "{\"a\": 1.0, \"b\": 2}").get();
         assert value.equals("OK");
         
      • set

        public static java.util.concurrent.CompletableFuture<java.lang.String> set​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull GlideString key,
                                                                                   @NonNull
                                                                                   @NonNull GlideString path,
                                                                                   @NonNull
                                                                                   @NonNull GlideString value)
        Sets the JSON value at the specified path stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the value will be set. The key will be modified only if value is added as the last child in the specified path, or if the specified path acts as the parent of a new child being added.
        value - The value to set at the specific path, in JSON formatted GlideString.
        Returns:
        A simple "OK" response if the value is successfully set.
        Example:
        
         String value = Json.set(client, gs("doc"), gs("."), gs("{\"a\": 1.0, \"b\": 2}")).get();
         assert value.equals("OK");
         
      • set

        public static java.util.concurrent.CompletableFuture<java.lang.String> set​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String key,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String path,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String value,
                                                                                   @NonNull
                                                                                   @NonNull ConditionalChange setCondition)
        Sets the JSON value at the specified path stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the value will be set. The key will be modified only if value is added as the last child in the specified path, or if the specified path acts as the parent of a new child being added.
        value - The value to set at the specific path, in JSON formatted string.
        setCondition - Set the value only if the given condition is met (within the key or path).
        Returns:
        A simple "OK" response if the value is successfully set. If value isn't set because of setCondition, returns null.
        Example:
        
         String value = Json.set(client, "doc", ".", "{\"a\": 1.0, \"b\": 2}", ConditionalChange.ONLY_IF_DOES_NOT_EXIST).get();
         assert value.equals("OK");
         
      • set

        public static java.util.concurrent.CompletableFuture<java.lang.String> set​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull GlideString key,
                                                                                   @NonNull
                                                                                   @NonNull GlideString path,
                                                                                   @NonNull
                                                                                   @NonNull GlideString value,
                                                                                   @NonNull
                                                                                   @NonNull ConditionalChange setCondition)
        Sets the JSON value at the specified path stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the value will be set. The key will be modified only if value is added as the last child in the specified path, or if the specified path acts as the parent of a new child being added.
        value - The value to set at the specific path, in JSON formatted GlideString.
        setCondition - Set the value only if the given condition is met (within the key or path).
        Returns:
        A simple "OK" response if the value is successfully set. If value isn't set because of setCondition, returns null.
        Example:
        
         String value = Json.set(client, gs("doc"), gs("."), gs("{\"a\": 1.0, \"b\": 2}"), ConditionalChange.ONLY_IF_DOES_NOT_EXIST).get();
         assert value.equals("OK");
         
      • get

        public static java.util.concurrent.CompletableFuture<java.lang.String> get​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String key)
        Retrieves the JSON value at the specified path stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns a string representation of the JSON document. If key doesn't exist, returns null.
        Example:
        
         String value = Json.get(client, "doc").get();
         assert value.equals("{\"a\": 1.0, \"b\": 2}");
         
      • get

        public static java.util.concurrent.CompletableFuture<GlideString> get​(@NonNull
                                                                              @NonNull BaseClient client,
                                                                              @NonNull
                                                                              @NonNull GlideString key)
        Retrieves the JSON value at the specified path stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns a string representation of the JSON document. If key doesn't exist, returns null.
        Example:
        
         GlideString value = Json.get(client, gs("doc")).get();
         assert value.equals(gs("{\"a\": 1.0, \"b\": 2}"));
         
      • get

        public static java.util.concurrent.CompletableFuture<java.lang.String> get​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String key,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String[] paths)
        Retrieves the JSON value at the specified paths stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        paths - List of paths within the JSON document.
        Returns:
        • If one path is given:
          • For JSONPath (path starts with $): Returns a stringified JSON list replies for every possible path, or a string representation of an empty array, if path doesn't exist. If key doesn't exist, returns null .
          • For legacy path (path doesn't start with $): Returns a string representation of the value in paths. If paths doesn't exist, an error is raised. If key doesn't exist, returns null.
        • If multiple paths are given: Returns a stringified JSON, in which each path is a key, and it's corresponding value, is the value as if the path was executed in the command as a single path.
        In case of multiple paths, and paths are a mix of both JSONPath and legacy path, the command behaves as if all are JSONPath paths.
        Example:
        
         String value = Json.get(client, "doc", new String[] {"$"}).get();
         assert value.equals("{\"a\": 1.0, \"b\": 2}");
         String value = Json.get(client, "doc", new String[] {"$.a", "$.b"}).get();
         assert value.equals("{\"$.a\": [1.0], \"$.b\": [2]}");
         
      • get

        public static java.util.concurrent.CompletableFuture<GlideString> get​(@NonNull
                                                                              @NonNull BaseClient client,
                                                                              @NonNull
                                                                              @NonNull GlideString key,
                                                                              @NonNull
                                                                              @NonNull GlideString[] paths)
        Retrieves the JSON value at the specified paths stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        paths - List of paths within the JSON document.
        Returns:
        • If one path is given:
          • For JSONPath (path starts with $): Returns a stringified JSON list replies for every possible path, or a string representation of an empty array, if path doesn't exist. If key doesn't exist, returns null .
          • For legacy path (path doesn't start with $): Returns a string representation of the value in paths. If paths doesn't exist, an error is raised. If key doesn't exist, returns null.
        • If multiple paths are given: Returns a stringified JSON, in which each path is a key, and it's corresponding value, is the value as if the path was executed in the command as a single path.
        In case of multiple paths, and paths are a mix of both JSONPath and legacy path, the command behaves as if all are JSONPath paths.
        Example:
        
         GlideString value = Json.get(client, gs("doc"), new GlideString[] {gs("$")}).get();
         assert value.equals(gs("{\"a\": 1.0, \"b\": 2}"));
         GlideString value = Json.get(client, gs("doc"), new GlideString[] {gs("$.a"), gs("$.b")}).get();
         assert value.equals(gs("{\"$.a\": [1.0], \"$.b\": [2]}"));
         
      • get

        public static java.util.concurrent.CompletableFuture<java.lang.String> get​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String key,
                                                                                   @NonNull
                                                                                   @NonNull JsonGetOptions options)
        Retrieves the JSON value at the specified path stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        options - Options for formatting the byte representation of the JSON data. See JsonGetOptions.
        Returns:
        Returns a string representation of the JSON document. If key doesn't exist, returns null.
        Example:
        
         JsonGetOptions options = JsonGetOptions.builder()
                                      .indent("  ")
                                      .space(" ")
                                      .newline("\n")
                                      .build();
         String value = Json.get(client, "doc", "$", options).get();
         assert value.equals("{\n \"a\": \n  1.0\n ,\n \"b\": \n  2\n }");
         
      • get

        public static java.util.concurrent.CompletableFuture<GlideString> get​(@NonNull
                                                                              @NonNull BaseClient client,
                                                                              @NonNull
                                                                              @NonNull GlideString key,
                                                                              @NonNull
                                                                              @NonNull JsonGetOptionsBinary options)
        Retrieves the JSON value at the specified path stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        options - Options for formatting the byte representation of the JSON data. See JsonGetOptions.
        Returns:
        Returns a string representation of the JSON document. If key doesn't exist, returns null.
        Example:
        
         JsonGetOptions options = JsonGetOptions.builder()
                                      .indent("  ")
                                      .space(" ")
                                      .newline("\n")
                                      .build();
         GlideString value = Json.get(client, gs("doc"), gs("$"), options).get();
         assert value.equals(gs("{\n \"a\": \n  1.0\n ,\n \"b\": \n  2\n }"));
         
      • get

        public static java.util.concurrent.CompletableFuture<java.lang.String> get​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String key,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String[] paths,
                                                                                   @NonNull
                                                                                   @NonNull JsonGetOptions options)
        Retrieves the JSON value at the specified path stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        paths - List of paths within the JSON document.
        options - Options for formatting the byte representation of the JSON data. See JsonGetOptions.
        Returns:
        • If one path is given:
          • For JSONPath (path starts with $): Returns a stringified JSON list replies for every possible path, or a string representation of an empty array, if path doesn't exist. If key doesn't exist, returns null .
          • For legacy path (path doesn't start with $): Returns a string representation of the value in paths. If paths doesn't exist, an error is raised. If key doesn't exist, returns null.
        • If multiple paths are given: Returns a stringified JSON, in which each path is a key, and it's corresponding value, is the value as if the path was executed in the command as a single path.
        In case of multiple paths, and paths are a mix of both JSONPath and legacy path, the command behaves as if all are JSONPath paths.
        Example:
        
         JsonGetOptions options = JsonGetOptions.builder()
                                      .indent("  ")
                                      .space(" ")
                                      .newline("\n")
                                      .build();
         String value = Json.get(client, "doc", new String[] {"$.a", "$.b"}, options).get();
         assert value.equals("{\n \"$.a\": [\n  1.0\n ],\n \"$.b\": [\n  2\n ]\n}");
         
      • get

        public static java.util.concurrent.CompletableFuture<GlideString> get​(@NonNull
                                                                              @NonNull BaseClient client,
                                                                              @NonNull
                                                                              @NonNull GlideString key,
                                                                              @NonNull
                                                                              @NonNull GlideString[] paths,
                                                                              @NonNull
                                                                              @NonNull JsonGetOptionsBinary options)
        Retrieves the JSON value at the specified path stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        paths - List of paths within the JSON document.
        options - Options for formatting the byte representation of the JSON data. See JsonGetOptions.
        Returns:
        • If one path is given:
          • For JSONPath (path starts with $): Returns a stringified JSON list replies for every possible path, or a string representation of an empty array, if path doesn't exist. If key doesn't exist, returns null .
          • For legacy path (path doesn't start with $): Returns a string representation of the value in paths. If paths doesn't exist, an error is raised. If key doesn't exist, returns null.
        • If multiple paths are given: Returns a stringified JSON, in which each path is a key, and it's corresponding value, is the value as if the path was executed in the command as a single path.
        In case of multiple paths, and paths are a mix of both JSONPath and legacy path, the command behaves as if all are JSONPath paths.
        Example:
        
         JsonGetOptions options = JsonGetOptions.builder()
                                      .indent("  ")
                                      .space(" ")
                                      .newline("\n")
                                      .build();
         GlideString value = Json.get(client, gs("doc"), new GlideString[] {gs("$.a"), gs("$.b")}, options).get();
         assert value.equals(gs("{\n \"$.a\": [\n  1.0\n ],\n \"$.b\": [\n  2\n ]\n}"));
         
      • mget

        public static java.util.concurrent.CompletableFuture<java.lang.String[]> mget​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String[] keys,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String path)
        Retrieves the JSON values at the specified path stored at multiple keys .
        Parameters:
        client - The client to execute the command.
        keys - The keys of the JSON documents.
        path - The path within the JSON documents.
        Returns:
        An array with requested values for each key.
        • For JSONPath (path starts with $): Returns a stringified JSON list replies for every possible path, or a string representation of an empty array, if path doesn't exist.
        • For legacy path (path doesn't start with $): Returns a string representation of the value in path. If path doesn't exist, the corresponding array element will be null.
        If a key doesn't exist, the corresponding array element will be null .
        Example:
        
         Json.set(client, "doc1", "$", "{\"a\": 1, \"b\": [\"one\", \"two\"]}").get();
         Json.set(client, "doc2", "$", "{\"a\": 1, \"c\": false}").get();
         var res = Json.mget(client, new String[] { "doc1", "doc2", "non_existing" }, "$.c").get();
         assert Arrays.equals(res, new String[] { "[]", "[false]", null });
         
      • mget

        public static java.util.concurrent.CompletableFuture<GlideString[]> mget​(@NonNull
                                                                                 @NonNull BaseClient client,
                                                                                 @NonNull
                                                                                 @NonNull GlideString[] keys,
                                                                                 @NonNull
                                                                                 @NonNull GlideString path)
        Retrieves the JSON values at the specified path stored at multiple keys .
        Parameters:
        client - The client to execute the command.
        keys - The keys of the JSON documents.
        path - The path within the JSON documents.
        Returns:
        An array with requested values for each key.
        • For JSONPath (path starts with $): Returns a stringified JSON list replies for every possible path, or a string representation of an empty array, if path doesn't exist.
        • For legacy path (path doesn't start with $): Returns a string representation of the value in path. If path doesn't exist, the corresponding array element will be null.
        If a key doesn't exist, the corresponding array element will be null .
        Example:
        
         Json.set(client, "doc1", "$", "{\"a\": 1, \"b\": [\"one\", \"two\"]}").get();
         Json.set(client, "doc2", "$", "{\"a\": 1, \"c\": false}").get();
         var res = Json.mget(client, new GlideString[] { gs("doc1"), gs("doc2"), gs("doc3") }, gs("$.c")).get();
         assert Arrays.equals(res, new GlideString[] { gs("[]"), gs("[false]"), null });
         
      • arrappend

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrappend​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String key,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String path,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String[] values)
        Appends one or more values to the JSON array at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the values will be appended.
        values - The JSON values to be appended to the array.
        JSON string values must be wrapped with quotes. For example, to append "foo", pass "\"foo\"".
        Returns:
        • For JSONPath (path starts with $):
          Returns a list of integers for every possible path, indicating the new length of the array after appending values, or null for JSON values matching the path that are not an array. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns the new length of the array after appending values to the array at path. If multiple paths are matched, returns the last updated array. If the JSON value at path is not a array or if path doesn't exist, an error is raised. If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1, \"b\": [\"one\", \"two\"]}").get();
         var res = Json.arrappend(client, "doc", "$.b", new String[] {"\"three\""}).get();
         assert Arrays.equals((Object[]) res, new int[] {3}); // New length of the array after appending
         res = Json.arrappend(client, "doc", ".b", new String[] {"\"four\""}).get();
         assert res.equals(4); // New length of the array after appending
         
      • arrappend

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrappend​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull GlideString key,
                                                                                         @NonNull
                                                                                         @NonNull GlideString path,
                                                                                         @NonNull
                                                                                         @NonNull GlideString[] values)
        Appends one or more values to the JSON array at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the values will be appended.
        values - The JSON values to be appended to the array.
        JSON string values must be wrapped with quotes. For example, to append "foo", pass "\"foo\"".
        Returns:
        • For JSONPath (path starts with $):
          Returns a list of integers for every possible path, indicating the new length of the new array after appending values, or null for JSON values matching the path that are not an array. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns the length of the new array after appending values to the array at path. If multiple paths are matched, returns the last updated array. If the JSON value at path is not a array or if path doesn't exist, an error is raised. If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1, \"b\": [\"one\", \"two\"]}").get();
         var res = Json.arrappend(client, gs("doc"), gs("$.b"), new GlideString[] {gs("\"three\"")}).get();
         assert Arrays.equals((Object[]) res, new int[] {3}); // New length of the array after appending
         res = Json.arrappend(client, gs("doc"), gs(".b"), new GlideString[] {gs("\"four\"")}).get();
         assert res.equals(4); // New length of the array after appending
         
      • arrinsert

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrinsert​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String key,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String path,
                                                                                         int index,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String[] values)
        Inserts one or more values into the array at the specified path within the JSON document stored at key, before the given index.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        index - The array index before which values are inserted.
        values - The JSON values to be inserted into the array.
        JSON string values must be wrapped with quotes. For example, to insert "foo", pass "\"foo\"".
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of integers for every possible path, indicating the new length of the array, or null for JSON values matching the path that are not an array. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns an integer representing the new length of the array. If multiple paths are matched, returns the length of the first modified array. If path doesn't exist or the value at path is not an array, an error is raised.
        If the index is out of bounds or key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "[[], [\"a\"], [\"a\", \"b\"]]").get();
         var newValues = new String[] { "\"c\"", "{\"key\": \"value\"}", "true", "null", "[\"bar\"]" };
         var res = Json.arrinsert(client, "doc", "$[*]", 0, newValues).get();
         assert Arrays.equals((Object[]) res, new int[] { 5, 6, 7 }); // New lengths of arrays after insertion
         var doc = Json.get(client, "doc").get();
         assert doc.equals("[[\"c\", {\"key\": \"value\"}, true, null, [\"bar\"]], [\"c\", {\"key\": \"value\"}, "
             + "true, null, [\"bar\"], \"a\"], [\"c\", {\"key\": \"value\"}, true, null, [\"bar\"], \"a\", \"b\"]]");
        
         Json.set(client, "doc", "$", "[[], [\"a\"], [\"a\", \"b\"]]").get();
         res = Json.arrinsert(client, "doc", ".", 0, new String[] { "\"c\"" }).get();
         assert res == 4 // New length of the root array after insertion
         doc = Json.get(client, "doc").get();
         assert doc.equals("[\"c\", [], [\"a\"], [\"a\", \"b\"]]");
         
      • arrinsert

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrinsert​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull GlideString key,
                                                                                         @NonNull
                                                                                         @NonNull GlideString path,
                                                                                         int index,
                                                                                         @NonNull
                                                                                         @NonNull GlideString[] values)
        Inserts one or more values into the array at the specified path within the JSON document stored at key, before the given index.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        index - The array index before which values are inserted.
        values - The JSON values to be inserted into the array.
        JSON string values must be wrapped with quotes. For example, to insert "foo", pass "\"foo\"".
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of integers for every possible path, indicating the new length of the array, or null for JSON values matching the path that are not an array. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns an integer representing the new length of the array. If multiple paths are matched, returns the length of the first modified array. If path doesn't exist or the value at path is not an array, an error is raised.
        If the index is out of bounds or key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "[[], [\"a\"], [\"a\", \"b\"]]").get();
         var newValues = new GlideString[] { gs("\"c\""), gs("{\"key\": \"value\"}"), gs("true"), gs("null"), gs("[\"bar\"]") };
         var res = Json.arrinsert(client, gs("doc"), gs("$[*]"), 0, newValues).get();
         assert Arrays.equals((Object[]) res, new int[] { 5, 6, 7 }); // New lengths of arrays after insertion
         var doc = Json.get(client, "doc").get();
         assert doc.equals("[[\"c\", {\"key\": \"value\"}, true, null, [\"bar\"]], [\"c\", {\"key\": \"value\"}, "
             + "true, null, [\"bar\"], \"a\"], [\"c\", {\"key\": \"value\"}, true, null, [\"bar\"], \"a\", \"b\"]]");
        
         Json.set(client, "doc", "$", "[[], [\"a\"], [\"a\", \"b\"]]").get();
         res = Json.arrinsert(client, gs("doc"), gs("."), 0, new GlideString[] { gs("\"c\"") }).get();
         assert res == 4 // New length of the root array after insertion
         doc = Json.get(client, "doc").get();
         assert doc.equals("[\"c\", [], [\"a\"], [\"a\", \"b\"]]");
         
      • arrindex

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrindex​(@NonNull
                                                                                        @NonNull BaseClient client,
                                                                                        @NonNull
                                                                                        @NonNull java.lang.String key,
                                                                                        @NonNull
                                                                                        @NonNull java.lang.String path,
                                                                                        @NonNull
                                                                                        @NonNull java.lang.String scalar)
        Searches for the first occurrence of a scalar JSON value in the arrays at the path.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        scalar - The scalar value to search for.
        Returns:
        • For JSONPath (path starts with $): Returns an array with a list of integers for every possible path, indicating the index of the matching element. The value is -1 if not found. If a value is not an array, its corresponding return value is null.
        • For legacy path (path doesn't start with $): Returns an integer representing the index of matching element, or -1 if not found. If the value at the path is not an array, an error is raised.
        Example:
        
         Json.set(client, key, "$", "{\"a\": [\"value\", 3], \"b\": {\"a\": [3, [\"value\", false], 5]}}").get();
         var result = Json.arrindex(client, key, "$..a", "3").get();
         assert Arrays.equals((Object[]) result, new Object[] {1L, 0L});
        
         result = Json.arrindex(client, key, "$..a", "\"value\"").get();
         assert Arrays.equals((Object[]) result, new Object[] {0L, -1L});
         
      • arrindex

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrindex​(@NonNull
                                                                                        @NonNull BaseClient client,
                                                                                        @NonNull
                                                                                        @NonNull GlideString key,
                                                                                        @NonNull
                                                                                        @NonNull GlideString path,
                                                                                        @NonNull
                                                                                        @NonNull GlideString scalar)
        Searches for the first occurrence of a scalar JSON value in the arrays at the path.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        scalar - The scalar value to search for.
        Returns:
        • For JSONPath (path starts with $): Returns an array with a list of integers for every possible path, indicating the index of the matching element. The value is -1 if not found. If a value is not an array, its corresponding return value is null.
        • For legacy path (path doesn't start with $): Returns an integer representing the index of matching element, or -1 if not found. If the value at the path is not an array, an error is raised.
        Example:
        
         Json.set(client, key, "$", "{\"a\": [\"value\", 3], \"b\": {\"a\": [3, [\"value\", false], 5]}}").get();
         var result = Json.arrindex(client, gs(key), gs("$..a"), gs("3")).get();
         assert Arrays.equals((Object[]) result, new Object[] {1L, 0L});
        
         // Searches for the first occurrence of null in the arrays
         result = Json.arrindex(client, gs(key), gs("$..a"), gs("null")).get();
         assert Arrays.equals((Object[]) result, new Object[] {-1L, -1L});
         
      • arrindex

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrindex​(@NonNull
                                                                                        @NonNull BaseClient client,
                                                                                        @NonNull
                                                                                        @NonNull java.lang.String key,
                                                                                        @NonNull
                                                                                        @NonNull java.lang.String path,
                                                                                        @NonNull
                                                                                        @NonNull java.lang.String scalar,
                                                                                        @NonNull
                                                                                        @NonNull JsonArrindexOptions options)
        Searches for the first occurrence of a scalar JSON value in the arrays at the path.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        scalar - The scalar value to search for.
        options - The additional options for the command. See JsonArrindexOptions.
        Returns:
        • For JSONPath (path starts with $): Returns an array with a list of integers for every possible path, indicating the index of the matching element. The value is -1 if not found. If a value is not an array, its corresponding return value is null.
        • For legacy path (path doesn't start with $): Returns an integer representing the index of matching element, or -1 if not found. If the value at the path is not an array, an error is raised.
        Example:
        
         Json.set(client, key, "$", "{\"a\": [\"value\", 3], \"b\": {\"a\": [3, [\"value\", false], 5]}}").get();
         var result = Json.arrindex(client, key, ".a", "3", new JsonArrindexOptions(0L)).get();
         assert Arrays.equals(1L, result);
         
      • arrindex

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrindex​(@NonNull
                                                                                        @NonNull BaseClient client,
                                                                                        @NonNull
                                                                                        @NonNull GlideString key,
                                                                                        @NonNull
                                                                                        @NonNull GlideString path,
                                                                                        @NonNull
                                                                                        @NonNull GlideString scalar,
                                                                                        @NonNull
                                                                                        @NonNull JsonArrindexOptions options)
        Searches for the first occurrence of a scalar JSON value in the arrays at the path.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        scalar - The scalar value to search for.
        options - The additional options for the command. See JsonArrindexOptions.
        Returns:
        • For JSONPath (path starts with $): Returns an array with a list of integers for every possible path, indicating the index of the matching element. The value is -1 if not found. If a value is not an array, its corresponding return value is null..
        • For legacy path (path doesn't start with $): Returns an integer representing the index of matching element, or -1 if not found. If the value at the path is not an array, an error is raised.
        Example:
        
         Json.set(client, key, "$", "{\"a\": [\"value\", 3], \"b\": {\"a\": [3, [\"value\", false], 5]}}").get();
         var result = Json.arrindex(client, gs(key), gs(".a"), gs("3"), new JsonArrindexOptions(0L)).get();
         assert Arrays.equals(1L, result);
         
      • arrlen

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrlen​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String key,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String path)
        Retrieves the length of the array at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of integers for every possible path, indicating the length of the array, or null for JSON values matching the path that are not an array. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns an integer representing the length of the array. If multiple paths are matched, returns the length of the first matching array. If path doesn't exist or the value at path is not an array, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": [1, 2, 3], \"b\": {\"a\": [1, 2], \"c\": {\"a\": 42}}}").get();
         var res = Json.arrlen(client, "doc", "$").get();
         assert Arrays.equals((Object[]) res, new Object[] { null }); // No array at the root path.
         res = Json.arrlen(client, "doc", "$.a").get();
         assert Arrays.equals((Object[]) res, new Object[] { 3 }); // Retrieves the length of the array at path $.a.
         res = Json.arrlen(client, "doc", "$..a").get();
         assert Arrays.equals((Object[]) res, new Object[] { 3, 2, null }); // Retrieves lengths of arrays found at all levels of the path `..a`.
         res = Json.arrlen(client, "doc", "..a").get();
         assert res == 3; // Legacy path retrieves the first array match at path `..a`.
         
      • arrlen

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrlen​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull GlideString key,
                                                                                      @NonNull
                                                                                      @NonNull GlideString path)
        Retrieves the length of the array at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of integers for every possible path, indicating the length of the array, or null for JSON values matching the path that are not an array. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns an integer representing the length of the array. If multiple paths are matched, returns the length of the first matching array. If path doesn't exist or the value at path is not an array, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": [1, 2, 3], \"b\": {\"a\": [1, 2], \"c\": {\"a\": 42}}}").get();
         var res = Json.arrlen(client, gs("doc"), gs("$")).get();
         assert Arrays.equals((Object[]) res, new Object[] { null }); // No array at the root path.
         res = Json.arrlen(client, gs("doc"), gs("$.a")).get();
         assert Arrays.equals((Object[]) res, new Object[] { 3 }); // Retrieves the length of the array at path $.a.
         res = Json.arrlen(client, gs("doc"), gs("$..a")).get();
         assert Arrays.equals((Object[]) res, new Object[] { 3, 2, null }); // Retrieves lengths of arrays found at all levels of the path `..a`.
         res = Json.arrlen(client, gs("doc"), gs("..a")).get();
         assert res == 3; // Legacy path retrieves the first array match at path `..a`.
         
      • arrlen

        public static java.util.concurrent.CompletableFuture<java.lang.Long> arrlen​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String key)
        Retrieves the length of the array at the root of the JSON document stored at key.
        Equivalent to arrlen(BaseClient, String, String) with path set to ".".
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        The array length stored at the root of the document. If document root is not an array, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2, true, null, \"tree\"]").get();
         var res = Json.arrlen(client, "doc").get();
         assert res == 5;
         
      • arrlen

        public static java.util.concurrent.CompletableFuture<java.lang.Long> arrlen​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key)
        Retrieves the length of the array at the root of the JSON document stored at key. Equivalent to arrlen(BaseClient, GlideString, GlideString) with path set to gs(".").
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        The array length stored at the root of the document. If document root is not an array, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2, true, null, \"tree\"]").get();
         var res = Json.arrlen(client, gs("doc")).get();
         assert res == 5;
         
      • debugMemory

        public static java.util.concurrent.CompletableFuture<java.lang.Object> debugMemory​(@NonNull
                                                                                           @NonNull BaseClient client,
                                                                                           @NonNull
                                                                                           @NonNull java.lang.String key,
                                                                                           @NonNull
                                                                                           @NonNull java.lang.String path)
        Reports memory usage in bytes of a JSON object at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of numbers for every possible path, indicating the memory usage. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns an integer representing the memory usage. If multiple paths are matched, returns the data of the first matching object. If path doesn't exist, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2.3, \"foo\", true, null, {}, [], {\"a\":1, \"b\":2}, [1, 2, 3]]").get();
         var res = Json.debugMemory(client, "doc", "..").get();
         assert res == 258L;
         
      • debugFields

        public static java.util.concurrent.CompletableFuture<java.lang.Object> debugFields​(@NonNull
                                                                                           @NonNull BaseClient client,
                                                                                           @NonNull
                                                                                           @NonNull java.lang.String key,
                                                                                           @NonNull
                                                                                           @NonNull java.lang.String path)
        Reports the number of fields at the specified path within the JSON document stored at key.
        Each non-container JSON value counts as one field. Objects and arrays recursively count one field for each of their containing JSON values. Each container value, except the root container, counts as one additional field.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of numbers for every possible path, indicating the number of fields. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns an integer representing the number of fields. If multiple paths are matched, returns the data of the first matching object. If path doesn't exist, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2.3, \"foo\", true, null, {}, [], {\"a\":1, \"b\":2}, [1, 2, 3]]").get();
         var res = Json.debugFields(client, "doc", "$[*]").get();
         assert Arrays.equals((Object[]) res, new Object[] {1, 1, 1, 1, 1, 0, 0, 2, 3});
         
      • debugMemory

        public static java.util.concurrent.CompletableFuture<java.lang.Object> debugMemory​(@NonNull
                                                                                           @NonNull BaseClient client,
                                                                                           @NonNull
                                                                                           @NonNull GlideString key,
                                                                                           @NonNull
                                                                                           @NonNull GlideString path)
        Reports memory usage in bytes of a JSON object at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of numbers for every possible path, indicating the memory usage. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns an integer representing the memory usage. If multiple paths are matched, returns the data of the first matching object. If path doesn't exist, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2.3, \"foo\", true, null, {}, [], {\"a\":1, \"b\":2}, [1, 2, 3]]").get();
         var res = Json.debugMemory(client, gs("doc"), gs("..")).get();
         assert res == 258L;
         
      • debugFields

        public static java.util.concurrent.CompletableFuture<java.lang.Object> debugFields​(@NonNull
                                                                                           @NonNull BaseClient client,
                                                                                           @NonNull
                                                                                           @NonNull GlideString key,
                                                                                           @NonNull
                                                                                           @NonNull GlideString path)
        Reports the number of fields at the specified path within the JSON document stored at key.
        Each non-container JSON value counts as one field. Objects and arrays recursively count one field for each of their containing JSON values. Each container value, except the root container, counts as one additional field.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of numbers for every possible path, indicating the number of fields. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns an integer representing the number of fields. If multiple paths are matched, returns the data of the first matching object. If path doesn't exist, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2.3, \"foo\", true, null, {}, [], {\"a\":1, \"b\":2}, [1, 2, 3]]").get();
         var res = Json.debugFields(client, gs("doc"), gs("$[*]")).get();
         assert Arrays.equals((Object[]) res, new Object[] {1, 1, 1, 1, 1, 0, 0, 2, 3});
         
      • debugMemory

        public static java.util.concurrent.CompletableFuture<java.lang.Long> debugMemory​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String key)
        Reports memory usage in bytes of a JSON object at the specified path within the JSON document stored at key.
        Equivalent to debugMemory(BaseClient, String, String) with path set to "..".
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        The total memory usage in bytes of the entire JSON document.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2.3, \"foo\", true, null, {}, [], {\"a\":1, \"b\":2}, [1, 2, 3]]").get();
         var res = Json.debugMemory(client, "doc").get();
         assert res == 258L;
         
      • debugFields

        public static java.util.concurrent.CompletableFuture<java.lang.Long> debugFields​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String key)
        Reports the number of fields at the specified path within the JSON document stored at key.
        Each non-container JSON value counts as one field. Objects and arrays recursively count one field for each of their containing JSON values. Each container value, except the root container, counts as one additional field.
        Equivalent to debugFields(BaseClient, String, String) with path set to "..".
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        The total number of fields in the entire JSON document.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2.3, \"foo\", true, null, {}, [], {\"a\":1, \"b\":2}, [1, 2, 3]]").get();
         var res = Json.debugFields(client, "doc").get();
         assert res == 14L;
         
      • debugMemory

        public static java.util.concurrent.CompletableFuture<java.lang.Long> debugMemory​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull GlideString key)
        Reports memory usage in bytes of a JSON object at the specified path within the JSON document stored at key.
        Equivalent to debugMemory(BaseClient, GlideString, GlideString) with path set to gs("..").
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        The total memory usage in bytes of the entire JSON document.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2.3, \"foo\", true, null, {}, [], {\"a\":1, \"b\":2}, [1, 2, 3]]").get();
         var res = Json.debugMemory(client, gs("doc")).get();
         assert res == 258L;
         
      • debugFields

        public static java.util.concurrent.CompletableFuture<java.lang.Long> debugFields​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull GlideString key)
        Reports the number of fields at the specified path within the JSON document stored at key.
        Each non-container JSON value counts as one field. Objects and arrays recursively count one field for each of their containing JSON values. Each container value, except the root container, counts as one additional field.
        Equivalent to debugFields(BaseClient, GlideString, GlideString) with path set to gs("..").
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        The total number of fields in the entire JSON document.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2.3, \"foo\", true, null, {}, [], {\"a\":1, \"b\":2}, [1, 2, 3]]").get();
         var res = Json.debugFields(client, gs("doc")).get();
         assert res == 14L;
         
      • arrpop

        public static java.util.concurrent.CompletableFuture<java.lang.String> arrpop​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String key)
        Pops the last element from the array stored in the root of the JSON document stored at key. Equivalent to arrpop(BaseClient, String, String) with path set to ".".
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns a string representing the popped JSON value, or null if the array at document root is empty.
        If the JSON value at document root is not an array or if key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2, true, {\"a\": 42, \"b\": 33}, \"tree\"]").get();
         var res = Json.arrpop(client, "doc").get();
         assert res.equals("\"tree\"");
         res = Json.arrpop(client, "doc").get();
         assert res.equals("{\"a\": 42, \"b\": 33}");
         
      • arrpop

        public static java.util.concurrent.CompletableFuture<GlideString> arrpop​(@NonNull
                                                                                 @NonNull BaseClient client,
                                                                                 @NonNull
                                                                                 @NonNull GlideString key)
        Pops the last element from the array located in the root of the JSON document stored at key. Equivalent to arrpop(BaseClient, GlideString, GlideString) with path set to gs(".").
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns a string representing the popped JSON value, or null if the array at document root is empty.
        If the JSON value at document root is not an array or if key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2, true, {\"a\": 42, \"b\": 33}, \"tree\"]").get();
         var res = Json.arrpop(client, gs("doc")).get();
         assert res.equals(gs("\"tree\""));
         res = Json.arrpop(client, gs("doc")).get();
         assert res.equals(gs("{\"a\": 42, \"b\": 33}"));
         
      • arrpop

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrpop​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String key,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String path)
        Pops the last element from the array located at path in the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an array with a strings for every possible path, representing the popped JSON values, or null for JSON values matching the path that are not an array or an empty array.
        • For legacy path (path doesn't start with $):
          Returns a string representing the popped JSON value, or null if the array at path is empty. If multiple paths are matched, the value from the first matching array that is not empty is returned. If path doesn't exist or the value at path is not an array, an error is raised.
        If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2, true, {\"a\": 42, \"b\": 33}, \"tree\"]").get();
         var res = Json.arrpop(client, "doc", "$").get();
         assert Arrays.equals((Object[]) res, new Object[] { "\"tree\"" });
         res = Json.arrpop(client, "doc", ".").get();
         assert res.equals("{\"a\": 42, \"b\": 33}");
         
      • arrpop

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrpop​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull GlideString key,
                                                                                      @NonNull
                                                                                      @NonNull GlideString path)
        Pops the last element from the array located at path in the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an array with a strings for every possible path, representing the popped JSON values, or null for JSON values matching the path that are not an array or an empty array.
        • For legacy path (path doesn't start with $):
          Returns a string representing the popped JSON value, or null if the array at path is empty. If multiple paths are matched, the value from the first matching array that is not empty is returned. If path doesn't exist or the value at path is not an array, an error is raised.
        If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2, true, {\"a\": 42, \"b\": 33}, \"tree\"]").get();
         var res = Json.arrpop(client, gs("doc"), gs("$")).get();
         assert Arrays.equals((Object[]) res, new Object[] { gs("\"tree\"") });
         res = Json.arrpop(client, gs("doc"), gs(".")).get();
         assert res.equals(gs("{\"a\": 42, \"b\": 33}"));
         
      • arrpop

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrpop​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String key,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String path,
                                                                                      long index)
        Pops an element from the array located at path in the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        index - The index of the element to pop. Out of boundary indexes are rounded to their respective array boundaries.
        Returns:
        • For JSONPath (path starts with $):
          Returns an array with a strings for every possible path, representing the popped JSON values, or null for JSON values matching the path that are not an array or an empty array.
        • For legacy path (path doesn't start with $):
          Returns a string representing the popped JSON value, or null if the array at path is empty. If multiple paths are matched, the value from the first matching array that is not empty is returned. If path doesn't exist or the value at path is not an array, an error is raised.
        If key doesn't exist, an error is raised.
        Example:
        
         String doc = "{\"a\": [1, 2, true], \"b\": {\"a\": [3, 4, [\"value\", 3, false], 5], \"c\": {\"a\": 42}}}";
         Json.set(client, "doc", "$", doc).get();
         var res = Json.arrpop(client, "doc", "$.a", 1).get();
         assert res.equals("2"); // Pop second element from array at path `$.a`
        
         Json.set(client, "doc", "$", "[[], [\"a\"], [\"a\", \"b\", \"c\"]]").get();
         res = Json.arrpop(client, "doc", ".", -1).get());
         assert res.equals("[\"a\", \"b\", \"c\"]"); // Pop last elements at path `.`
         
      • arrpop

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrpop​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull GlideString key,
                                                                                      @NonNull
                                                                                      @NonNull GlideString path,
                                                                                      long index)
        Pops an element from the array located at path in the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        index - The index of the element to pop. Out of boundary indexes are rounded to their respective array boundaries.
        Returns:
        • For JSONPath (path starts with $):
          Returns an array with a strings for every possible path, representing the popped JSON values, or null for JSON values matching the path that are not an array or an empty array.
        • For legacy path (path doesn't start with $):
          Returns a string representing the popped JSON value, or null if the array at path is empty. If multiple paths are matched, the value from the first matching array that is not empty is returned. If path doesn't exist or the value at path is not an array, an error is raised.
        If key doesn't exist, an error is raised.
        Example:
        
         String doc = "{\"a\": [1, 2, true], \"b\": {\"a\": [3, 4, [\"value\", 3, false], 5], \"c\": {\"a\": 42}}}";
         Json.set(client, "doc", "$", doc).get();
         var res = Json.arrpop(client, gs("doc"), gs("$.a"), 1).get();
         assert res.equals("2"); // Pop second element from array at path `$.a`
        
         Json.set(client, "doc", "$", "[[], [\"a\"], [\"a\", \"b\", \"c\"]]").get();
         res = Json.arrpop(client, gs("doc"), gs("."), -1).get());
         assert res.equals(gs("[\"a\", \"b\", \"c\"]")); // Pop last elements at path `.`
         
      • arrtrim

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrtrim​(@NonNull
                                                                                       @NonNull BaseClient client,
                                                                                       @NonNull
                                                                                       @NonNull java.lang.String key,
                                                                                       @NonNull
                                                                                       @NonNull java.lang.String path,
                                                                                       int start,
                                                                                       int end)
        Trims an array at the specified path within the JSON document stored at key so that it becomes a subarray [start, end], both inclusive.
        If start < 0, it is treated as 0.
        If end >= size (size of the array), it is treated as size -1.
        If start >= size or start > end, the array is emptied and 0 is return.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        start - The index of the first element to keep, inclusive.
        end - The index of the last element to keep, inclusive.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of integers for every possible path, indicating the new length of the array, or null for JSON values matching the path that are not an array. If the array is empty, its corresponding return value is 0. If path doesn't exist, an empty array will be return. If an index argument is out of bounds, an error is raised.
        • For legacy path (path doesn't start with $):
          Returns an integer representing the new length of the array. If the array is empty, its corresponding return value is 0. If multiple paths match, the length of the first trimmed array match is returned. If path doesn't exist, or the value at path is not an array, an error is raised. If an index argument is out of bounds, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{[], [\"a\"], [\"a\", \"b\"], [\"a\", \"b\", \"c\"]}").get();
         var res = Json.arrtrim(client, "doc", "$[*]", 0, 1).get();
         assert Arrays.equals((Object[]) res, new Object[] { 0, 1, 2, 2 }); // New lengths of arrays after trimming
        
         Json.set(client, "doc", "$", "{\"children\": [\"John\", \"Jack\", \"Tom\", \"Bob\", \"Mike\"]}").get();
         res = Json.arrtrim(client, "doc", ".children", 0, 1).get();
         assert res == 2; // new length after trimming
         
      • arrtrim

        public static java.util.concurrent.CompletableFuture<java.lang.Object> arrtrim​(@NonNull
                                                                                       @NonNull BaseClient client,
                                                                                       @NonNull
                                                                                       @NonNull GlideString key,
                                                                                       @NonNull
                                                                                       @NonNull GlideString path,
                                                                                       int start,
                                                                                       int end)
        Trims an array at the specified path within the JSON document stored at key so that it becomes a subarray [start, end], both inclusive.
        If start < 0, it is treated as 0.
        If end >= size (size of the array), it is treated as size -1.
        If start >= size or start > end, the array is emptied and 0 is return.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        start - The index of the first element to keep, inclusive.
        end - The index of the last element to keep, inclusive.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of integers for every possible path, indicating the new length of the array, or null for JSON values matching the path that are not an array. If the array is empty, its corresponding return value is 0. If path doesn't exist, an empty array will be return. If an index argument is out of bounds, an error is raised.
        • For legacy path (path doesn't start with $):
          Returns an integer representing the new length of the array. If the array is empty, its corresponding return value is 0. If multiple paths match, the length of the first trimmed array match is returned. If path doesn't exist, or the value at path is not an array, an error is raised. If an index argument is out of bounds, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{[], [\"a\"], [\"a\", \"b\"], [\"a\", \"b\", \"c\"]}").get();
         var res = Json.arrtrim(client, gs("doc"), gs("$[*]"), 0, 1).get();
         assert Arrays.equals((Object[]) res, new Object[] { 0, 1, 2, 2 }); // New lengths of arrays after trimming
        
         Json.set(client, "doc", "$", "{\"children\": [\"John\", \"Jack\", \"Tom\", \"Bob\", \"Mike\"]}").get();
         res = Json.arrtrim(client, gs("doc"), gs(".children"), 0, 1).get();
         assert res == 2; // new length after trimming
         
      • numincrby

        public static java.util.concurrent.CompletableFuture<java.lang.String> numincrby​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String key,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String path,
                                                                                         java.lang.Number number)
        Increments or decrements the JSON value(s) at the specified path by number within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        number - The number to increment or decrement by.
        Returns:
        • For JSONPath (path starts with $):
          Returns a string representation of an array of strings, indicating the new values after incrementing for each matched path.
          If a value is not a number, its corresponding return value will be null.
          If path doesn't exist, a byte string representation of an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns a string representation of the resulting value after the increment or decrement.
          If multiple paths match, the result of the last updated value is returned.
          If the value at the path is not a number or path doesn't exist, an error is raised.
        If key does not exist, an error is raised.
        If the result is out of the range of 64-bit IEEE double, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"c\": [1, 2], \"d\": [1, 2, 3]}").get();
         var res = Json.numincrby(client, "doc", "$.d[*]", 10.0).get();
         assert res.equals("[11,12,13]"); // Increment each element in `d` array by 10.
        
         res = Json.numincrby(client, "doc", ".c[1]", 10.0).get();
         assert res.equals("12"); // Increment the second element in the `c` array by 10.
         
      • numincrby

        public static java.util.concurrent.CompletableFuture<GlideString> numincrby​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key,
                                                                                    @NonNull
                                                                                    @NonNull GlideString path,
                                                                                    java.lang.Number number)
        Increments or decrements the JSON value(s) at the specified path by number within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        number - The number to increment or decrement by.
        Returns:
        • For JSONPath (path starts with $):
          Returns a GlideString representation of an array of strings, indicating the new values after incrementing for each matched path.
          If a value is not a number, its corresponding return value will be null.
          If path doesn't exist, a byte string representation of an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns a GlideString representation of the resulting value after the increment or decrement.
          If multiple paths match, the result of the last updated value is returned.
          If the value at the path is not a number or path doesn't exist, an error is raised.
        If key does not exist, an error is raised.
        If the result is out of the range of 64-bit IEEE double, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"c\": [1, 2], \"d\": [1, 2, 3]}").get();
         var res = Json.numincrby(client, gs("doc"), gs("$.d[*]"), 10.0).get();
         assert res.equals(gs("[11,12,13]")); // Increment each element in `d` array by 10.
        
         res = Json.numincrby(client, gs("doc"), gs(".c[1]"), 10.0).get();
         assert res.equals(gs("12")); // Increment the second element in the `c` array by 10.
         
      • nummultby

        public static java.util.concurrent.CompletableFuture<java.lang.String> nummultby​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String key,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String path,
                                                                                         java.lang.Number number)
        Multiplies the JSON value(s) at the specified path by number within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        number - The number to multiply by.
        Returns:
        • For JSONPath (path starts with $):
          Returns a string representation of an array of strings, indicating the new values after multiplication for each matched path.
          If a value is not a number, its corresponding return value will be null.
          If path doesn't exist, a byte string representation of an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns a string representation of the resulting value after multiplication.
          If multiple paths match, the result of the last updated value is returned.
          If the value at the path is not a number or path doesn't exist, an error is raised.
        If key does not exist, an error is raised.
        If the result is out of the range of 64-bit IEEE double, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"c\": [1, 2], \"d\": [1, 2, 3]}").get();
         var res = Json.nummultby(client, "doc", "$.d[*]", 2.0).get();
         assert res.equals("[2,4,6]"); // Multiplies each element in the `d` array by 2.
        
         res = Json.nummultby(client, "doc", ".c[1]", 2.0).get();
         assert res.equals("12"); // Multiplies the second element in the `c` array by 2.
         
      • nummultby

        public static java.util.concurrent.CompletableFuture<GlideString> nummultby​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key,
                                                                                    @NonNull
                                                                                    @NonNull GlideString path,
                                                                                    java.lang.Number number)
        Multiplies the JSON value(s) at the specified path by number within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        number - The number to multiply by.
        Returns:
        • For JSONPath (path starts with $):
          Returns a GlideString representation of an array of strings, indicating the new values after multiplication for each matched path.
          If a value is not a number, its corresponding return value will be null.
          If path doesn't exist, a byte string representation of an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns a GlideString representation of the resulting value after multiplication.
          If multiple paths match, the result of the last updated value is returned.
          If the value at the path is not a number or path doesn't exist, an error is raised.
        If key does not exist, an error is raised.
        If the result is out of the range of 64-bit IEEE double, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"c\": [1, 2], \"d\": [1, 2, 3]}").get();
         var res = Json.nummultby(client, gs("doc"), gs("$.d[*]"), 2.0).get();
         assert res.equals(gs("[2,4,6]")); // Multiplies each element in the `d` array by 2.
        
         res = Json.nummultby(client, gs("doc"), gs(".c[1]"), 2.0).get();
         assert res.equals(gs("12")); // Multiplies the second element in the `c` array by 2.
         
      • objlen

        public static java.util.concurrent.CompletableFuture<java.lang.Long> objlen​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String key)
        Retrieves the number of key-value pairs in the object values at the specified path within the JSON document stored at key.
        Equivalent to objlen(BaseClient, String, String) with path set to ".".
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        The object length stored at the root of the document. If document root is not an object, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1.0, \"b\": {\"a\": {\"x\": 1, \"y\": 2}, \"b\": 2.5, \"c\": true}}").get();
         var res = Json.objlen(client, "doc").get();
         assert res == 2; // the size of object matching the path `.`, which has 2 keys: 'a' and 'b'.
         
      • objlen

        public static java.util.concurrent.CompletableFuture<java.lang.Long> objlen​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key)
        Retrieves the number of key-value pairs in the object values at the specified path within the JSON document stored at key.
        Equivalent to objlen(BaseClient, GlideString, GlideString) with path set to gs(".").
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        The object length stored at the root of the document. If document root is not an object, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1.0, \"b\": {\"a\": {\"x\": 1, \"y\": 2}, \"b\": 2.5, \"c\": true}}").get();
         var res = Json.objlen(client, gs("doc"), gs(".")).get();
         assert res == 2; // the size of object matching the path `.`, which has 2 keys: 'a' and 'b'.
         
      • objlen

        public static java.util.concurrent.CompletableFuture<java.lang.Object> objlen​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String key,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String path)
        Retrieves the number of key-value pairs in the object values at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of long integers for every possible path, indicating the number of key-value pairs for each matching object, or null for JSON values matching the path that are not an object. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns the number of key-value pairs for the object value matching the path. If multiple paths are matched, returns the length of the first matching object. If path doesn't exist or the value at path is not an array, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1.0, \"b\": {\"a\": {\"x\": 1, \"y\": 2}, \"b\": 2.5, \"c\": true}}").get();
         var res = Json.objlen(client, "doc", ".").get(); // legacy path - command returns first value as `Long`
         assert res == 2L; // the size of object matching the path `.`, which has 2 keys: 'a' and 'b'.
        
         res = Json.objlen(client, "doc", "$.b").get(); // JSONPath - command returns an array
         assert Arrays.equals((Object[]) res, new Object[] { 3L }); // the length of the objects at path `$.b`
         
      • objlen

        public static java.util.concurrent.CompletableFuture<java.lang.Object> objlen​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull GlideString key,
                                                                                      @NonNull
                                                                                      @NonNull GlideString path)
        Retrieves the number of key-value pairs in the object values at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[] with a list of long integers for every possible path, indicating the number of key-value pairs for each matching object, or null for JSON values matching the path that are not an object. If path does not exist, an empty array will be returned.
        • For legacy path (path doesn't start with $):
          Returns the number of key-value pairs for the object value matching the path. If multiple paths are matched, returns the length of the first matching object. If path doesn't exist or the value at path is not an array, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1.0, \"b\": {\"a\": {\"x\": 1, \"y\": 2}, \"b\": 2.5, \"c\": true}}").get();
         var res = Json.objlen(client, gs("doc"), gs(".")).get(); // legacy path - command returns first value as `Long`
         assert res == 2L; // the size of object matching the path `.`, which has 2 keys: 'a' and 'b'.
        
         res = Json.objlen(client, gs("doc"), gs("$.b")).get(); // JSONPath - command returns an array
         assert Arrays.equals((Object[]) res, new Object[] { 3L }); // the length of the objects at path `$.b`
         
      • objkeys

        public static java.util.concurrent.CompletableFuture<java.lang.Object[]> objkeys​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String key)
        Retrieves the key names in the object values at the specified path within the JSON document stored at key.
        Equivalent to objkeys(BaseClient, String, String) with path set to ".".
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        The object length stored at the root of the document. If document root is not an object, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1.0, \"b\": {\"a\": {\"x\": 1, \"y\": 2}, \"b\": 2.5, \"c\": true}}").get();
         var res = Json.objkeys(client, "doc").get();
         assert Arrays.equals((Object[]) res, new Object[] { "a", "b" }); // the keys of the object matching the path `.`, which has 2 keys: 'a' and 'b'.
         
      • objkeys

        public static java.util.concurrent.CompletableFuture<java.lang.Object[]> objkeys​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull GlideString key)
        Retrieves the key names in the object values at the specified path within the JSON document stored at key.
        Equivalent to objkeys(BaseClient, GlideString, GlideString) with path set to gs(".").
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        The object length stored at the root of the document. If document root is not an object, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1.0, \"b\": {\"a\": {\"x\": 1, \"y\": 2}, \"b\": 2.5, \"c\": true}}").get();
         var res = Json.objkeys(client, gs("doc"), gs(".")).get();
         assert Arrays.equals((Object[]) res, new Object[] { gs("a"), gs("b") }); // the keys of the object matching the path `.`, which has 2 keys: 'a' and 'b'.
         
      • objkeys

        public static java.util.concurrent.CompletableFuture<java.lang.Object[]> objkeys​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String key,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String path)
        Retrieves the key names in the object values at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[][] with each nested array containing key names for each matching object for every possible path, indicating the list of object keys for each matching object, or null for JSON values matching the path that are not an object. If path does not exist, an empty sub-array will be returned.
        • For legacy path (path doesn't start with $):
          Returns an array of object keys for the object value matching the path. If multiple paths are matched, returns the length of the first matching object. If path doesn't exist or the value at path is not an array, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1.0, \"b\": {\"a\": {\"x\": 1, \"y\": 2}, \"b\": 2.5, \"c\": true}}").get();
         var res = Json.objkeys(client, "doc", ".").get(); // legacy path - command returns array for first matched object
         assert Arrays.equals((Object[]) res, new Object[] { "a", "b" }); // key names for the object matching the path `.` as it is the only match.
        
         res = Json.objkeys(client, "doc", "$.b").get(); // JSONPath - command returns an array for each matched object
         assert Arrays.equals((Object[]) res, new Object[][] { { "a", "b", "c" } }); // key names as a nested list for objects matching the JSONPath `$.b`.
         
      • objkeys

        public static java.util.concurrent.CompletableFuture<java.lang.Object[]> objkeys​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull GlideString key,
                                                                                         @NonNull
                                                                                         @NonNull GlideString path)
        Retrieves the key names in the object values at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns an Object[][] with each nested array containing key names for each matching object for every possible path, indicating the list of object keys for each matching object, or null for JSON values matching the path that are not an object. If path does not exist, an empty sub-array will be returned.
        • For legacy path (path doesn't start with $):
          Returns an array of object keys for the object value matching the path. If multiple paths are matched, returns the length of the first matching object. If path doesn't exist or the value at path is not an array, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1.0, \"b\": {\"a\": {\"x\": 1, \"y\": 2}, \"b\": 2.5, \"c\": true}}").get();
         var res = Json.objkeys(client, gs("doc"), gs(".")).get(); // legacy path - command returns array for first matched object
         assert Arrays.equals((Object[]) res, new Object[] { "a", "b" }); // key names for the object matching the path `.` as it is the only match.
        
         res = Json.objkeys(client, gs("doc"), gs("$.b")).get(); // JSONPath - command returns an array for each matched object
         assert Arrays.equals((Object[]) res, new Object[][] { { "a", "b", "c" } }); // key names as a nested list for objects matching the JSONPath `$.b`.
         
      • del

        public static java.util.concurrent.CompletableFuture<java.lang.Long> del​(@NonNull
                                                                                 @NonNull BaseClient client,
                                                                                 @NonNull
                                                                                 @NonNull java.lang.String key)
        Deletes the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        The number of elements deleted. 0 if the key does not exist.
        Example:
        
         Json.set(client, "doc", ".", "{\"a\": 1, \"nested\": {\"a\": 2, \"b\": 3}}");
         Long result = Json.del(client, "doc").get();
         assert result == 1L;
         
      • del

        public static java.util.concurrent.CompletableFuture<java.lang.Long> del​(@NonNull
                                                                                 @NonNull BaseClient client,
                                                                                 @NonNull
                                                                                 @NonNull GlideString key)
        Deletes the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        The number of elements deleted. 0 if the key does not exist.
        Example:
        
         Json.set(client, "doc", ".", "{\"a\": 1, \"nested\": {\"a\": 2, \"b\": 3}}");
         Long result = Json.del(client, gs("doc")).get();
         assert result == 1L;
         
      • del

        public static java.util.concurrent.CompletableFuture<java.lang.Long> del​(@NonNull
                                                                                 @NonNull BaseClient client,
                                                                                 @NonNull
                                                                                 @NonNull java.lang.String key,
                                                                                 @NonNull
                                                                                 @NonNull java.lang.String path)
        Deletes the JSON value at the specified path within the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the value will be deleted.
        Returns:
        The number of elements deleted. 0 if the key does not exist, or if the JSON path is invalid or does not exist.
        Example:
        
         Json.set(client, "doc", ".", "{\"a\": 1, \"nested\": {\"a\": 2, \"b\": 3}}");
         Long result = Json.del(client, "doc", "$..a").get();
         assert result == 2L;
         
      • del

        public static java.util.concurrent.CompletableFuture<java.lang.Long> del​(@NonNull
                                                                                 @NonNull BaseClient client,
                                                                                 @NonNull
                                                                                 @NonNull GlideString key,
                                                                                 @NonNull
                                                                                 @NonNull GlideString path)
        Deletes the JSON value at the specified path within the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the value will be deleted.
        Returns:
        The number of elements deleted. 0 if the key does not exist, or if the JSON path is invalid or does not exist.
        Example:
        
         Json.set(client, "doc", ".", "{\"a\": 1, \"nested\": {\"a\": 2, \"b\": 3}}");
         Long result = Json.del(client, gs("doc"), gs("$..a")).get();
         assert result == 2L;
         
      • forget

        public static java.util.concurrent.CompletableFuture<java.lang.Long> forget​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String key)
        Deletes the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        The number of elements deleted. 0 if the key does not exist.
        Example:
        
         Json.set(client, "doc", ".", "{\"a\": 1, \"nested\": {\"a\": 2, \"b\": 3}}");
         Long result = Json.forget(client, "doc").get();
         assert result == 1L;
         
      • forget

        public static java.util.concurrent.CompletableFuture<java.lang.Long> forget​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key)
        Deletes the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        The number of elements deleted. 0 if the key does not exist.
        Example:
        
         Json.set(client, "doc", ".", "{\"a\": 1, \"nested\": {\"a\": 2, \"b\": 3}}");
         Long result = Json.forget(client, gs("doc")).get();
         assert result == 1L;
         
      • forget

        public static java.util.concurrent.CompletableFuture<java.lang.Long> forget​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String key,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String path)
        Deletes the JSON value at the specified path within the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the value will be deleted.
        Returns:
        The number of elements deleted. 0 if the key does not exist, or if the JSON path is invalid or does not exist.
        Example:
        
         Json.set(client, "doc", ".", "{\"a\": 1, \"nested\": {\"a\": 2, \"b\": 3}}");
         Long result = Json.forget(client, "doc", "$..a").get();
         assert result == 2L;
         
      • forget

        public static java.util.concurrent.CompletableFuture<java.lang.Long> forget​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key,
                                                                                    @NonNull
                                                                                    @NonNull GlideString path)
        Deletes the JSON value at the specified path within the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the value will be deleted.
        Returns:
        The number of elements deleted. 0 if the key does not exist, or if the JSON path is invalid or does not exist.
        Example:
        
         Json.set(client, "doc", ".", "{\"a\": 1, \"nested\": {\"a\": 2, \"b\": 3}}");
         Long result = Json.forget(client, gs("doc"), gs("$..a")).get();
         assert result == 2L;
         
      • toggle

        public static java.util.concurrent.CompletableFuture<java.lang.Boolean> toggle​(@NonNull
                                                                                       @NonNull BaseClient client,
                                                                                       @NonNull
                                                                                       @NonNull java.lang.String key)
        Toggles a Boolean value stored at the root within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns the toggled boolean value at the root of the document, or null for JSON values matching the root that are not boolean. If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", ".", true).get();
         var res = Json.toggle(client, "doc").get();
         assert res.equals(false);
         res = Json.toggle(client, "doc").get();
         assert res.equals(true);
         
      • toggle

        public static java.util.concurrent.CompletableFuture<java.lang.Boolean> toggle​(@NonNull
                                                                                       @NonNull BaseClient client,
                                                                                       @NonNull
                                                                                       @NonNull GlideString key)
        Toggles a Boolean value stored at the root within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns the toggled boolean value at the root of the document, or null for JSON values matching the root that are not boolean. If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", ".", true).get();
         var res = Json.toggle(client, gs("doc")).get();
         assert res.equals(false);
         res = Json.toggle(client, gs("doc")).get();
         assert res.equals(true);
         
      • toggle

        public static java.util.concurrent.CompletableFuture<java.lang.Object> toggle​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String key,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String path)
        Toggles a Boolean value stored at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns a Boolean[] with the toggled boolean value for every possible path, or null for JSON values matching the path that are not boolean.
        • For legacy path (path doesn't start with $):
          Returns the value of the toggled boolean in path. If path doesn't exist or the value at path isn't a boolean, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"bool\": true, \"nested\": {\"bool\": false, \"nested\": {\"bool\": 10}}}").get();
         var res = Json.toggle(client, "doc", "$..bool").get();
         assert Arrays.equals((Boolean[]) res, new Boolean[] {false, true, null});
         res = Json.toggle(client, "doc", "bool").get();
         assert res.equals(true);
         var getResult = Json.get(client, "doc", "$").get();
         assert getResult.equals("{\"bool\": true, \"nested\": {\"bool\": true, \"nested\": {\"bool\": 10}}}");
         
      • toggle

        public static java.util.concurrent.CompletableFuture<java.lang.Object> toggle​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull GlideString key,
                                                                                      @NonNull
                                                                                      @NonNull GlideString path)
        Toggles a Boolean value stored at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns a Boolean[] with the toggled boolean value for every possible path, or null for JSON values matching the path that are not boolean.
        • For legacy path (path doesn't start with $):
          Returns the value of the toggled boolean in path. If path doesn't exist or the value at path isn't a boolean, an error is raised.
        If key doesn't exist, returns null.
        Example:
        
         Json.set(client, "doc", "$", "{\"bool\": true, \"nested\": {\"bool\": false, \"nested\": {\"bool\": 10}}}").get();
         var res = Json.toggle(client, gs("doc"), gs("$..bool")).get();
         assert Arrays.equals((Boolean[]) res, new Boolean[] {false, true, null});
         res = Json.toggle(client, gs("doc"), gs("bool")).get();
         assert res.equals(true);
         var getResult = Json.get(client, "doc", "$").get();
         assert getResult.equals("{\"bool\": true, \"nested\": {\"bool\": true, \"nested\": {\"bool\": 10}}}");
         
      • strappend

        public static java.util.concurrent.CompletableFuture<java.lang.Object> strappend​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String key,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String value,
                                                                                         @NonNull
                                                                                         @NonNull java.lang.String path)
        Appends the specified value to the string stored at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        value - The value to append to the string. Must be wrapped with single quotes. For example, to append "foo", pass '"foo"'.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns a list of integer replies for every possible path, indicating the length of the resulting string after appending value, or null for JSON values matching the path that are not string.
          If key doesn't exist, an error is raised.
        • For legacy path (path doesn't start with $):
          Returns the length of the resulting string after appending value to the string at path.
          If multiple paths match, the length of the last updated string is returned.
          If the JSON value at path is not a string of if path doesn't exist, an error is raised.
          If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\":\"foo\", \"nested\": {\"a\": \"hello\"}, \"nested2\": {\"a\": 31}}").get();
         var res = Json.strappend(client, "doc", "baz", "$..a").get();
         assert Arrays.equals((Object[]) res, new Object[] {6L, 8L, null}); // The new length of the string values at path '$..a' in the key stored at `doc` after the append operation.
        
         res = Json.strappend(client, "doc", '"foo"', "nested.a").get();
         assert (Long) res == 11L; // The length of the string value after appending "foo" to the string at path 'nested.array' in the key stored at `doc`.
        
         var getResult = Json.get(client, "doc", "$").get();
         assert getResult.equals("[{\"a\":\"foobaz\", \"nested\": {\"a\": \"hellobazfoo\"}, \"nested2\": {\"a\": 31}}]"); // The updated JSON value in the key stored at `doc`.
         
      • strappend

        public static java.util.concurrent.CompletableFuture<java.lang.Object> strappend​(@NonNull
                                                                                         @NonNull BaseClient client,
                                                                                         @NonNull
                                                                                         @NonNull GlideString key,
                                                                                         @NonNull
                                                                                         @NonNull GlideString value,
                                                                                         @NonNull
                                                                                         @NonNull GlideString path)
        Appends the specified value to the string stored at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        value - The value to append to the string. Must be wrapped with single quotes. For example, to append "foo", pass '"foo"'.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns a list of integer replies for every possible path, indicating the length of the resulting string after appending value, or null for JSON values matching the path that are not string.
          If key doesn't exist, an error is raised.
        • For legacy path (path doesn't start with $):
          Returns the length of the resulting string after appending value to the string at path.
          If multiple paths match, the length of the last updated string is returned.
          If the JSON value at path is not a string of if path doesn't exist, an error is raised.
          If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\":\"foo\", \"nested\": {\"a\": \"hello\"}, \"nested2\": {\"a\": 31}}").get();
         var res = Json.strappend(client, gs("doc"), gs("baz"), gs("$..a")).get();
         assert Arrays.equals((Object[]) res, new Object[] {6L, 8L, null}); // The new length of the string values at path '$..a' in the key stored at `doc` after the append operation.
        
         res = Json.strappend(client, gs("doc"), gs("'\"foo\"'"), gs("nested.a")).get();
         assert (Long) res == 11L; // The length of the string value after appending "foo" to the string at path 'nested.array' in the key stored at `doc`.
        
         var getResult = Json.get(client, gs("doc"), gs("$")).get();
         assert getResult.equals("[{\"a\":\"foobaz\", \"nested\": {\"a\": \"hellobazfoo\"}, \"nested2\": {\"a\": 31}}]"); // The updated JSON value in the key stored at `doc`.
         
      • strappend

        public static java.util.concurrent.CompletableFuture<java.lang.Long> strappend​(@NonNull
                                                                                       @NonNull BaseClient client,
                                                                                       @NonNull
                                                                                       @NonNull java.lang.String key,
                                                                                       @NonNull
                                                                                       @NonNull java.lang.String value)
        Appends the specified value to the string stored at the root within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        value - The value to append to the string. Must be wrapped with single quotes. For example, to append "foo", pass '"foo"'.
        Returns:
        Returns the length of the resulting string after appending value to the string at the root.
        If the JSON value at root is not a string, an error is raised.
        If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "'\"foo\"'").get();
         var res = Json.strappend(client, "doc", "'\"baz\"'").get();
         assert res == 6L; // The length of the string value after appending "foo" to the string at root in the key stored at `doc`.
        
         var getResult = Json.get(client, "doc").get();
         assert getResult.equals("\"foobaz\""); // The updated JSON value in the key stored at `doc`.
         
      • strappend

        public static java.util.concurrent.CompletableFuture<java.lang.Long> strappend​(@NonNull
                                                                                       @NonNull BaseClient client,
                                                                                       @NonNull
                                                                                       @NonNull GlideString key,
                                                                                       @NonNull
                                                                                       @NonNull GlideString value)
        Appends the specified value to the string stored at the root within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        value - The value to append to the string. Must be wrapped with single quotes. For example, to append "foo", pass '"foo"'.
        Returns:
        Returns the length of the resulting string after appending value to the string at the root.
        If the JSON value at root is not a string, an error is raised.
        If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "'\"foo\"'").get();
         var res = Json.strappend(client, gs("doc"), gs("'\"baz\"'")).get();
         assert res == 6L; // The length of the string value after appending "foo" to the string at root in the key stored at `doc`.
        
         var getResult = Json.get(client, gs("$"), gs("doc")).get();
         assert getResult.equals("\"foobaz\""); // The updated JSON value in the key stored at `doc`.
         
      • strlen

        public static java.util.concurrent.CompletableFuture<java.lang.Object> strlen​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String key,
                                                                                      @NonNull
                                                                                      @NonNull java.lang.String path)
        Returns the length of the JSON string value stored at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns a list of integer replies for every possible path, indicating the length of the JSON string value, or null for JSON values matching the path that are not string.
        • For legacy path (path doesn't start with $):
          Returns the length of the JSON value at path or null if key doesn't exist.
          If multiple paths match, the length of the first matched string is returned.
          If the JSON value at path is not a string of if path doesn't exist, an error is raised. If key doesn't exist, null is returned.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\":\"foo\", \"nested\": {\"a\": \"hello\"}, \"nested2\": {\"a\": 31}}").get();
         var res = Json.strlen(client, "doc", "$..a").get();
         assert Arrays.equals((Object[]) res, new Object[] {3L, 5L, null}); // The length of the string values at path '$..a' in the key stored at `doc`.
        
         res = Json.strlen(client, "doc", "nested.a").get();
         assert (Long) res == 5L; // The length of the JSON value at path 'nested.a' in the key stored at `doc`.
        
         res = Json.strlen(client, "doc", "$").get();
         assert Arrays.equals((Object[]) res, new Object[] {null}); // Returns an array with null since the value at root path does in the JSON document stored at `doc` is not a string.
        
         res = Json.strlen(client, "non_existing_key", ".").get();
         assert res == null; // `key` doesn't exist.
         
      • strlen

        public static java.util.concurrent.CompletableFuture<java.lang.Object> strlen​(@NonNull
                                                                                      @NonNull BaseClient client,
                                                                                      @NonNull
                                                                                      @NonNull GlideString key,
                                                                                      @NonNull
                                                                                      @NonNull GlideString path)
        Returns the length of the JSON string value stored at the specified path within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $):
          Returns a list of integer replies for every possible path, indicating the length of the JSON string value, or null for JSON values matching the path that are not string.
        • For legacy path (path doesn't start with $):
          Returns the length of the JSON value at path or null if key doesn't exist.
          If multiple paths match, the length of the first matched string is returned.
          If the JSON value at path is not a string of if path doesn't exist, an error is raised. If key doesn't exist, null is returned.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\":\"foo\", \"nested\": {\"a\": \"hello\"}, \"nested2\": {\"a\": 31}}").get();
         var res = Json.strlen(client, gs("doc"), gs("$..a")).get();
         assert Arrays.equals((Object[]) res, new Object[] {3L, 5L, null}); // The length of the string values at path '$..a' in the key stored at `doc`.
        
         res = Json.strlen(client, gs("doc"), gs("nested.a")).get();
         assert (Long) res == 5L; // The length of the JSON value at path 'nested.a' in the key stored at `doc`.
        
         res = Json.strlen(client, gs("doc"), gs("$")).get();
         assert Arrays.equals((Object[]) res, new Object[] {null}); // Returns an array with null since the value at root path does in the JSON document stored at `doc` is not a string.
        
         res = Json.strlen(client, gs("non_existing_key"), gs(".")).get();
         assert res == null; // `key` doesn't exist.
         
      • strlen

        public static java.util.concurrent.CompletableFuture<java.lang.Long> strlen​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String key)
        Returns the length of the JSON string value stored at the root within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns the length of the JSON value at the root.
        If the JSON value is not a string, an error is raised.
        If key doesn't exist, null is returned.
        Example:
        
         Json.set(client, "doc", "$", "\"Hello\"").get();
         var res = Json.strlen(client, "doc").get();
         assert res == 5L; // The length of the JSON value at the root in the key stored at `doc`.
        
         res = Json.strlen(client, "non_existing_key").get();
         assert res == null; // `key` doesn't exist.
         
      • strlen

        public static java.util.concurrent.CompletableFuture<java.lang.Long> strlen​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key)
        Returns the length of the JSON string value stored at the root within the JSON document stored at key.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns the length of the JSON value at the root.
        If the JSON value is not a string, an error is raised.
        If key doesn't exist, null is returned.
        Example:
        
         Json.set(client, "doc", "$", "\"Hello\"").get();
         var res = Json.strlen(client, gs("doc")).get();
         assert res == 5L; // The length of the JSON value at the root in the key stored at `doc`.
        
         res = Json.strlen(client, gs("non_existing_key")).get();
         assert res == null; // `key` doesn't exist.
         
      • clear

        public static java.util.concurrent.CompletableFuture<java.lang.Long> clear​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String key)
        Clears an array and an object at the root of the JSON document stored at key.
        Equivalent to clear(BaseClient, String, String) with path set to ".".
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        1 if the document wasn't empty or 0 if it was.
        If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\":1, \"b\":2}").get();
         long res = Json.clear(client, "doc").get();
         assert res == 1;
        
         var doc = Json.get(client, "doc", "$").get();
         assert doc.equals("[{}]");
        
         res = Json.clear(client, "doc").get();
         assert res == 0; // the doc is already empty
         
      • clear

        public static java.util.concurrent.CompletableFuture<java.lang.Long> clear​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull GlideString key)
        Clears an array and an object at the root of the JSON document stored at key.
        Equivalent to clear(BaseClient, GlideString, GlideString) with path set to ".".
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        Returns:
        1 if the document wasn't empty or 0 if it was.
        If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\":1, \"b\":2}").get();
         long res = Json.clear(client, gs("doc")).get();
         assert res == 1;
        
         var doc = Json.get(client, "doc", "$").get();
         assert doc.equals("[{}]");
        
         res = Json.clear(client, gs("doc")).get();
         assert res == 0; // the doc is already empty
         
      • clear

        public static java.util.concurrent.CompletableFuture<java.lang.Long> clear​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String key,
                                                                                   @NonNull
                                                                                   @NonNull java.lang.String path)
        Clears arrays and objects at the specified path within the JSON document stored at key.
        Numeric values are set to 0, boolean values are set to false, and string values are converted to empty strings.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        The number of containers cleared.
        If path doesn't exist, or the value at path is already cleared (e.g., an empty array, object, or string), 0 is returned. If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"obj\": {\"a\":1, \"b\":2}, \"arr\":[1, 2, 3], \"str\": \"foo\", \"bool\": true,
             \"int\": 42, \"float\": 3.14, \"nullVal\": null}").get();
         long res = Json.clear(client, "doc", "$.*").get();
         assert res == 6; // 6 values are cleared: "obj", "arr", "str", "bool", "int", and "float"; "nullVal" is not clearable.
        
         var doc = Json.get(client, "doc", "$").get();
         assert doc.equals("[{\"obj\":{},\"arr\":[],\"str\":\"\",\"bool\":false,\"int\":0,\"float\":0.0,\"nullVal\":null}]");
        
         res = Json.clear(client, "doc", "$.*").get();
         assert res == 0; // containers are already empty and nothing is cleared
         
      • clear

        public static java.util.concurrent.CompletableFuture<java.lang.Long> clear​(@NonNull
                                                                                   @NonNull BaseClient client,
                                                                                   @NonNull
                                                                                   @NonNull GlideString key,
                                                                                   @NonNull
                                                                                   @NonNull GlideString path)
        Clears arrays and objects at the specified path within the JSON document stored at key.
        Numeric values are set to 0, boolean values are set to false, and string values are converted to empty strings.
        Parameters:
        client - The client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        The number of containers cleared.
        If path doesn't exist, or the value at path is already cleared (e.g., an empty array, object, or string), 0 is returned. If key doesn't exist, an error is raised.
        Example:
        
         Json.set(client, "doc", "$", "{\"obj\": {\"a\":1, \"b\":2}, \"arr\":[1, 2, 3], \"str\": \"foo\", \"bool\": true,
             \"int\": 42, \"float\": 3.14, \"nullVal\": null}").get();
         long res = Json.clear(client, gs("doc"), gs("$.*")).get();
         assert res == 6; // 6 values are cleared: "obj", "arr", "str", "bool", "int", and "float"; "nullVal" is not clearable.
        
         var doc = Json.get(client, "doc", "$").get();
         assert doc.equals("[{\"obj\":{},\"arr\":[],\"str\":\"\",\"bool\":false,\"int\":0,\"float\":0.0,\"nullVal\":null}]");
        
         res = Json.clear(client, gs("doc"), gs("$.*")).get();
         assert res == 0; // containers are already empty and nothing is cleared
         
      • resp

        public static java.util.concurrent.CompletableFuture<java.lang.Object> resp​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String key)
        Retrieves the JSON document stored at key. The returning result is in the Valkey or Redis OSS Serialization Protocol (RESP).
        • JSON null is mapped to the RESP Null Bulk String.
        • JSON Booleans are mapped to RESP Simple string.
        • JSON integers are mapped to RESP Integers.
        • JSON doubles are mapped to RESP Bulk Strings.
        • JSON strings are mapped to RESP Bulk Strings.
        • JSON arrays are represented as RESP arrays, where the first element is the simple string [, followed by the array's elements.
        • JSON objects are represented as RESP object, where the first element is the simple string {, followed by key-value pairs, each of which is a RESP bulk string.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns the JSON document in its RESP form. If key doesn't exist, null is returned.
        Example:
        {@code
         Json.set(client, "doc", ".", "{\"a\": [1, 2, 3], \"b\": {\"b1\": 1}, \"c\": 42}");
         Object actualResult = Json.resp(client, "doc").get();
         Object[] expectedResult = new Object[] {
             "{",
             new Object[] {"a", new Object[] {"[", 1L, 2L, 3L}},
             new Object[] {"b", new Object[] {"{", new Object[] {"b1", 1L}}},
             new Object[] {"c", 42L}
         };
         assertInstanceOf(Object[].class, actualResult);
         assertArrayEquals(expectedResult, (Object[]) actualResult);
         }
      • resp

        public static java.util.concurrent.CompletableFuture<java.lang.Object> resp​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key)
        Retrieves the JSON document stored at key. The returning result is in the Valkey or Redis OSS Serialization Protocol (RESP).
        • JSON null is mapped to the RESP Null Bulk String.
        • JSON Booleans are mapped to RESP Simple string.
        • JSON integers are mapped to RESP Integers.
        • JSON doubles are mapped to RESP Bulk Strings.
        • JSON strings are mapped to RESP Bulk Strings.
        • JSON arrays are represented as RESP arrays, where the first element is the simple string [, followed by the array's elements.
        • JSON objects are represented as RESP object, where the first element is the simple string {, followed by key-value pairs, each of which is a RESP bulk string.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns the JSON document in its RESP form. If key doesn't exist, null is returned.
        Example:
        {@code
         Json.set(client, "doc", ".", "{\"a\": [1, 2, 3], \"b\": {\"b1\": 1}, \"c\": 42}");
         Object actualResultBinary = Json.resp(client, gs("doc")).get();
         Object[] expectedResultBinary = new Object[] {
             "{",
             new Object[] {gs("a"), new Object[] {gs("["), 1L, 2L, 3L}},
             new Object[] {gs("b"), new Object[] {gs("{"), new Object[] {gs("b1"), 1L}}},
             new Object[] {gs("c"), 42L}
         };
         assertInstanceOf(Object[].class, actualResultBinary);
         assertArrayEquals(expectedResultBinary, (Object[]) actualResultBinary);
         }
      • resp

        public static java.util.concurrent.CompletableFuture<java.lang.Object> resp​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String key,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String path)
        Retrieve the JSON value at the specified path within the JSON document stored at key. The returning result is in the Valkey or Redis OSS Serialization Protocol (RESP).
        • JSON null is mapped to the RESP Null Bulk String.
        • JSON Booleans are mapped to RESP Simple string.
        • JSON integers are mapped to RESP Integers.
        • JSON doubles are mapped to RESP Bulk Strings.
        • JSON strings are mapped to RESP Bulk Strings.
        • JSON arrays are represented as RESP arrays, where the first element is the simple string [, followed by the array's elements.
        • JSON objects are represented as RESP object, where the first element is the simple string {, followed by key-value pairs, each of which is a RESP bulk string.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $): Returns a list of replies for every possible path, indicating the RESP form of the JSON value. If path doesn't exist, returns an empty list.
        • For legacy path (path doesn't starts with $): Returns a single reply for the JSON value at the specified path, in its RESP form. If multiple paths match, the value of the first JSON value match is returned. If path doesn't exist, an error is raised.
        If key doesn't exist, null is returned.
        Example:
        
         Json.set(client, "doc", ".", "{\"a\": [1, 2, 3], \"b\": {\"a\": [1, 2], \"c\": {\"a\": 42}}}");
         Object actualResult = Json.resp(client, "doc", "$..a").get(); // JSONPath returns all possible paths
         Object[] expectedResult = new Object[] {
                         new Object[] {"[", 1L, 2L, 3L},
                         new Object[] {"[", 1L, 2L},
                         42L};
         assertArrayEquals(expectedResult, (Object[]) actualResult);
         // legacy path only returns the first JSON value match
         assertArrayEquals(new Object[] {"[", 1L, 2L, 3L}, (Object[]) Json.resp(client, key, "..a").get());
         
      • resp

        public static java.util.concurrent.CompletableFuture<java.lang.Object> resp​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key,
                                                                                    @NonNull
                                                                                    @NonNull GlideString path)
        Retrieve the JSON value at the specified path within the JSON document stored at key. The returning result is in the Valkey or Redis OSS Serialization Protocol (RESP).
        • JSON null is mapped to the RESP Null Bulk String.
        • JSON Booleans are mapped to RESP Simple string.
        • JSON integers are mapped to RESP Integers.
        • JSON doubles are mapped to RESP Bulk Strings.
        • JSON strings are mapped to RESP Bulk Strings.
        • JSON arrays are represented as RESP arrays, where the first element is the simple string [, followed by the array's elements.
        • JSON objects are represented as RESP object, where the first element is the simple string {, followed by key-value pairs, each of which is a RESP bulk string.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - The path within the JSON document.
        Returns:
        • For JSONPath (path starts with $): Returns a list of replies for every possible path, indicating the RESP form of the JSON value. If path doesn't exist, returns an empty list.
        • For legacy path (path doesn't starts with $): Returns a single reply for the JSON value at the specified path, in its RESP form. If multiple paths match, the value of the first JSON value match is returned. If path doesn't exist, an error is raised.
        If key doesn't exist, null is returned.
        Example:
        
         Json.set(client, "doc", ".", "{\"a\": [1, 2, 3], \"b\": {\"a\": [1, 2], \"c\": {\"a\": 42}}}");
         Object actualResult = Json.resp(client, gs("doc"), gs("$..a")).get(); // JSONPath returns all possible paths
         Object[] expectedResult = new Object[] {
                         new Object[] {gs("["), 1L, 2L, 3L},
                         new Object[] {gs("["), 1L, 2L},
                         42L};
         assertArrayEquals(expectedResult, (Object[]) actualResult);
         // legacy path only returns the first JSON value match
         assertArrayEquals(new Object[] {gs("["), 1L, 2L, 3L}, (Object[]) Json.resp(client, gs(key), gs("..a")).get());
         
      • type

        public static java.util.concurrent.CompletableFuture<java.lang.Object> type​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String key)
        Retrieves the type of the JSON value at the root of the JSON document stored at key .
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns the type of the JSON value at root. If key doesn't exist, null is returned.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2, 3]");
         assertEquals("array", Json.type(client, "doc").get());
        
         Json.set(client, "doc", "$", "{\"a\": 1}");
         assertEquals("object", Json.type(client, "doc").get());
        
         assertNull(Json.type(client, "non_existing_key").get());
         
      • type

        public static java.util.concurrent.CompletableFuture<java.lang.Object> type​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key)
        Retrieves the type of the JSON value at the root of the JSON document stored at key .
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        Returns:
        Returns the type of the JSON value at root. If key doesn't exist, null is returned.
        Example:
        
         Json.set(client, "doc", "$", "[1, 2, 3]");
         assertEquals(gs("array"), Json.type(client, gs("doc")).get());
        
         Json.set(client, "doc", "$", "{\"a\": 1}");
         assertEquals(gs("object"), Json.type(client, gs("doc")).get());
        
         assertNull(Json.type(client, gs("non_existing_key")).get());
         
      • type

        public static java.util.concurrent.CompletableFuture<java.lang.Object> type​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String key,
                                                                                    @NonNull
                                                                                    @NonNull java.lang.String path)
        Retrieves the type of the JSON value at the specified path within the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the type will be retrieved.
        Returns:
        • For JSONPath (path starts with $): Returns a list of string replies for every possible path, indicating the type of the JSON value. If `path` doesn't exist, an empty array will be returned.
        • For legacy path (path doesn't starts with $): Returns the type of the JSON value at `path`. If multiple paths match, the type of the first JSON value match is returned. If `path` doesn't exist, null will be returned.
        If key doesn't exist, null is returned.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1, \"nested\": {\"a\": 2, \"b\": 3}}");
         assertArrayEquals(new Object[]{"object"}, (Object[]) Json.type(client, key, "$.nested").get());
         assertArrayEquals(new Object[]{"integer"}, (Object[]) Json.type(client, key, "$.nested.a").get());
         assertArrayEquals(new Object[]{"integer", "object"}, (Object[]) Json.type(client, key, "$[*]").get());
         
      • type

        public static java.util.concurrent.CompletableFuture<java.lang.Object> type​(@NonNull
                                                                                    @NonNull BaseClient client,
                                                                                    @NonNull
                                                                                    @NonNull GlideString key,
                                                                                    @NonNull
                                                                                    @NonNull GlideString path)
        Retrieves the type of the JSON value at the specified path within the JSON document stored at key.
        Parameters:
        client - The Valkey GLIDE client to execute the command.
        key - The key of the JSON document.
        path - Represents the path within the JSON document where the type will be retrieved.
        Returns:
        • For JSONPath (path starts with $): Returns a list of string replies for every possible path, indicating the type of the JSON value. If `path` doesn't exist, an empty array will be returned.
        • For legacy path (path doesn't starts with $): Returns the type of the JSON value at `path`. If multiple paths match, the type of the first JSON value match is returned. If `path` doesn't exist, null will be returned.
        If key doesn't exist, null is returned.
        Example:
        
         Json.set(client, "doc", "$", "{\"a\": 1, \"nested\": {\"a\": 2, \"b\": 3}}");
         assertArrayEquals(new Object[]{gs("object")}, (Object[]) Json.type(client, gs(key), gs("$.nested")).get());
         assertArrayEquals(new Object[]{gs("integer")}, (Object[]) Json.type(client, gs(key), gs("$.nested.a")).get());
         assertArrayEquals(new Object[]{gs("integer"), gs("object")}, (Object[]) Json.type(client, gs(key), gs("$[*]")).get());