-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
When we do
List<byte[]> argList = new ArrayList<>();
for (String key : keys) {
argList.add(key.getBytes(UTF_8));
}
argList.add(".".getBytes(UTF_8));
byte[][] args = argList.toArray(new byte[0][]);
var result = connection.execute("JSON.MGET", args);
we get a Json array with one element, the result from the last key.
We expect results for all keys.
run the test should return more than the last key to show the problem
see lettuce Issue here - the problem was already analyzed from lettuce side and found to be within SDR:
"it's not actually a Lettuce problem ...
Currently spring-data-redis doesn't have native JSON API, so you are forced to use the RAW command API. spring-data-redis doesn't allow you to choose the output type for yourself, but makes the choice on your behalf. And in the current scenario - makes wrong choice - ByteArrayOutput, which as you already found returns you only one of the keys.
TLDR - you should raise this issue to SDR and from what i saw it should be easy solution for them - to fix the mapping for JSON MGET to some sort of ListOutput - currently in Lettuce we use JsonValueListOutput."