Skip to content

Commit

Permalink
Redis Client: fix JSON.MGET parameters ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladicek committed Jul 2, 2024
1 parent 69ebf8a commit 7bf5773
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ Uni<Response> _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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,14 @@ void mget() {
json.jsonSet("doc1", j1);
json.jsonSet("doc2", j2);

List<JsonArray> arrays = json.jsonMget("doc1", "doc2", "$..a");
List<JsonArray> 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);
}

Expand Down

0 comments on commit 7bf5773

Please sign in to comment.