I'm trying to create an activity feed list in redis using the redis-node library and had a json serialization question.
If I lpush a value into a key, the values get stored as escaped json, and when I retrieve with lrange, I get a list of escaped json back.
Should I simply iterate over the list items and JSON.parse(item) each, or is there a better more efficient method? Specifically, is there a configuration I can use to avoid the overhead of escaping and unescaping the json values?
Use JSON.strinfigy(object) when storing your value and use JSON.parse(value) when retrieving it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With