redis node library json serialization for list values
Problem
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?
Related Articles
Solution
Use JSON.strinfigy(object)
when storing your value and use JSON.parse(value)
when retrieving it.
Discussion
View additional discussion.