Skip to content

HSET method not working with flattened hashes #276

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

Open
norbertbakoascenda opened this issue Jan 20, 2025 · 0 comments
Open

HSET method not working with flattened hashes #276

norbertbakoascenda opened this issue Jan 20, 2025 · 0 comments

Comments

@norbertbakoascenda
Copy link

Issue

As the title says:

  • Simple Redis (v.4.8.1) is working with flattened hashes
  • FakeRedis throws argument error

Proof

[1] pry(main)> hash = {:name=>"job", :namespace=>"default", :klass=>"Job"}
=> {:name=>"job", :namespace=>"default", :klass=>"Job"}
[2] pry(main)> redis = Redis.new
=> #<Redis client v4.8.1 for redis://localhost:6379/15>
[3] pry(main)> redis.hset "flatten_test", hash.flatten
=> 3
[4] pry(main)> redis.hgetall("flatten_test")
=> {"name"=>"job", "namespace"=>"default", "klass"=>"Job"}
[5] pry(main)> require 'fakeredis'
=> true
[6] pry(main)> fake_redis = Redis.new
=> #<Redis client v4.8.1 for redis://localhost:6379/15>
[7] pry(main)> fake_redis.hset "flatten_test", hash.flatten
Redis::CommandError: ERR wrong number of arguments for HMSET
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

1 participant