Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HGETALL returns array instead of hash #2

Closed
raphaottoni opened this issue Jun 19, 2015 · 1 comment
Closed

HGETALL returns array instead of hash #2

raphaottoni opened this issue Jun 19, 2015 · 1 comment

Comments

@raphaottoni
Copy link

Acessing the key from redis-rb gem using hgetall return a hash:

screen shot 2015-06-18 at 23 59 44

when accessing the same key with a lua script using redis-rb-scripting it returns a array:
screen shot 2015-06-19 at 00 31 34

hmget.lua
screen shot 2015-06-18 at 23 57 37

Same problem occur with wolverine gem:
Shopify/wolverine#13

@codekitchen
Copy link
Owner

This is because the redis-rb gem does special processing on the return value of hgetall, you can see how the return value is processed through the _hashify method before returning https://github.com/redis/redis-rb/blob/master/lib/redis.rb#L2013

You can see the same behavior without this gem, just calling eval on the redis connection directly. You'll just need to do the processing yourself when doing it via a lua script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants