ioredis icon indicating copy to clipboard operation
ioredis copied to clipboard

support for RedisJSON

Open KailasMahavarkar opened this issue 3 years ago • 5 comments

KailasMahavarkar avatar Jan 16 '22 21:01 KailasMahavarkar

Hi, community

I am developing a nodeJS application that requires me to use Redis cache for storing the data as objects. The problem is I want to store objects(3-4 level depth) with respecting their nested types.

right now I'm using some external plugins along with node-redis which uses flatten and unflatten to store value as Hash key-value pair which is again not good for performance but it's a working solution.

does the current version of ioredis support redisJSON? if not, is there any work going on in this direction?

KailasMahavarkar avatar Jan 18 '22 15:01 KailasMahavarkar

ioredis is able to execute arbitrary Redis commands via .call. You can do redis.call('JSON.GET', ...yourargs). Does this solve your issue?

luin avatar Jan 18 '22 16:01 luin

Is it possible to add docs for this feature?

wenq1 avatar Feb 15 '22 04:02 wenq1

@wenq1 Added an example: https://github.com/luin/ioredis/blob/main/examples/module.js.

luin avatar Mar 16 '22 07:03 luin

Thanks so much. already resolved.

wenq1 avatar May 22 '22 04:05 wenq1