diff --git a/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/AbstractJsonCommands.java b/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/AbstractJsonCommands.java index 8381d205b7ef1..ea074642ce18c 100644 --- a/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/AbstractJsonCommands.java +++ b/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/AbstractJsonCommands.java @@ -197,12 +197,12 @@ Uni _jsonMget(String path, K... keys) { notNullOrBlank(path, "path"); doesNotContainNull(keys, "keys"); - RedisCommand cmd = RedisCommand.of(Command.JSON_MGET) - .put(path); + RedisCommand cmd = RedisCommand.of(Command.JSON_MGET); for (K key : keys) { cmd.put(marshaller.encode(key)); } + cmd.put(path); return execute(cmd); } diff --git a/extensions/redis-client/runtime/src/test/java/io/quarkus/redis/datasource/JsonCommandsTest.java b/extensions/redis-client/runtime/src/test/java/io/quarkus/redis/datasource/JsonCommandsTest.java index 9ec69ab34dea4..c59e527f16de0 100644 --- a/extensions/redis-client/runtime/src/test/java/io/quarkus/redis/datasource/JsonCommandsTest.java +++ b/extensions/redis-client/runtime/src/test/java/io/quarkus/redis/datasource/JsonCommandsTest.java @@ -388,14 +388,14 @@ void mget() { json.jsonSet("doc1", j1); json.jsonSet("doc2", j2); - List arrays = json.jsonMget("doc1", "doc2", "$..a"); + List arrays = json.jsonMget("$..a", "doc1", "doc2"); assertThat(arrays.get(0)).containsExactly(1, 3); assertThat(arrays.get(1)).containsExactly(4, 6); - arrays = json.jsonMget("doc1", "doc2", "$..d"); + arrays = json.jsonMget("$..d", "doc1", "doc2"); assertThat(arrays).hasSize(2).allSatisfy(a -> assertThat(a).isEmpty()); - arrays = json.jsonMget("doc1", "$..a"); + arrays = json.jsonMget("$..a", "doc1"); assertThat(arrays.get(0)).containsExactly(1, 3); }