mkorkmaz / redislabs-rejson

Redislabs RedisJson aka ReJson Client for PHP (PHP 8.1+)
https://oss.redislabs.com/redisjson/
MIT License
42 stars 7 forks source link

json_encode / json_decode should be optional #8

Closed diplopito closed 3 years ago

diplopito commented 3 years ago

Hi @mkorkmaz!

Thanks for this library. I was wondering if the json enconding and decoding could be optional: i.e. to store json strings and be able to return them as they are --this is very handy for caching json responses to be consumed by API.

Cheers!

mkorkmaz commented 3 years ago

Hi @diplopito

RedisJson itself is a caching solution. Why do you need extra caching step? If the data is not that big, I believe decoding/encoding overhead is omittable.

If you still need to get json string from RedisJson, you can run raw command 'JSON.GET '

Is this answer ok with you?

diplopito commented 3 years ago

Hi @mkorkmaz,

I build complex json trees that ideally should be returned as JSON directly by the API, no need to decode and re-encode them. I will move forward with raw command and JSON.GET, thanks!