The package I'm using is redis. I used the following command to store a JSON array in Redis:
await redisClient.json.set('car.volume.tire', '$', []);
await redisClient.json.arrAppend('car.volume.tire', '$', { hello: 'there' });
But when I want to retrieve the element by index, I receive null
:
await redisClient.json.get(`car.volume.tire[0]`);
However, the following returns the full JSON array:
await redisClient.json.get(`car.volume.tire`);
What am I doing wrong?