I have been using node and redis for some time. The problem I am experiencing is, when I use hgetall in redis, it returns an object.
{ uid: '6203453597',
first_name: 'Name',
last_name: 'Surname',
gender: 'male',
email: '[email protected]',
status: '1',
chips: '4002043' }
However, when I use hmget and specify the fields I want to get, it returns an array.
[ '6203453597', 'Name', 'Surname', '4002043' ]
So, I would like to convert array to an associative array, just like the first one. What is the best way to convert it from code and performance wise.
I am also using the multi command in redis. So it returns an array of objects in the first example, in the second example it return an array of arrays. So, it is important it to be efficient and automatic, not manual.
YUI's dataschema function is what I am looking for. However it needs to be done on node.js and the only 3rd party utility tool I am using is underscore. Is there any easy way of doing this, or do I need to convert hem in a loop, manually.
Thanks,