1

I have a simple array as such :

[1,2,3,4,5]

and I wish to get a range for example from index 2 to index 4. I can get the last element of the array by :

json.get key .[-1]

However I cannot find anyway to return a specific results without trimming the array.

Is there anyway I can get a range of elements from a Redis json array?

Hypothesis
  • 1,208
  • 3
  • 17
  • 43

1 Answers1

1

The answer is :

await Client.json.get("key" , {path : '$.[1:3]'})

which gets index 1 to 3.

Hypothesis
  • 1,208
  • 3
  • 17
  • 43