Closed eggplants closed 1 year ago
Both sadd and sadd? adds a value into a set. But I'm confused that srem? doesn't remove a value like srem. Is it correct?
sadd
sadd?
srem?
srem
RUBY_VERSION #=> "3.0.6" Redis::VERSION #=> "4.8.1" Redis::Namespace::VERSION #=> "1.10.0" require "redis-namespace" redis_connection = Redis.new(host: ENV["REDIS_HOST"], port: ENV["REDIS_PORT"]) redis = Redis::Namespace.new("Rspec Instance", redis: redis_connection) set_key = "foo:bar" redis.smembers set_key #=> [] redis.sadd set_key, 1 #=> true redis.sadd? set_key, 2 #=> true $redis.smembers set_key #=> ["1", "2"] redis.srem set_key, 1 #=> true redis.srem? set_key, 2 #=> false $redis.smembers set_key #=> ["2"] $redis.srem set_key, 2 #=> true $redis.smembers set_key #=> []
It has already fixed in #224 and v1.11.0. After updating my issue was fixed.
Both
sadd
andsadd?
adds a value into a set. But I'm confused thatsrem?
doesn't remove a value likesrem
. Is it correct?