Open johnmanko opened 2 years ago
I don't see how the native JSON.<X>
methods can give any advantage to us. They allow to directly access embedded JSON objects / values, but we always use the root. The interface to the REDIS server is still string-based, so there is no change in serialization, except that ioredis now controls it.
These new methods are also not compatible with the open-source releases of redis.
Finally, changing to use call
will break the interface for users that use the client
option with alternative or custom clients.
Support plan
Context
What problem are you trying to solve?
This project uses
ioredis
'sRedis
.psetex
/get
for writing and reading user data as string data. This requires applications to deserialize cache data when reading.Do you have a new or modified API suggestion to solve the problem?
Alternatively, class
Redis
has a call method that supports direct Redis commands, such asGET
,SET
,JSON.GET
,JSON.SET
, etc. This project should be changed to exclusively use thecall
method and support all Redis supported commands. This can easily be done using a modifier to prefix commands.Examples:
With
prefix
=''
,'json.'
, etc based on plugin optionThere does seems to some inconsistency between the
set
/psetex
methods andcall
. It would be nice to pass command options right on thecall
, but I guess the extraexpire
can take care of that if it can be done in an async way.