I\'m wondering if there\'s a way to check if a key already exists in a redis list?
I can\'t use a set because I don\'t want to enforce uniqueness, but I do want to be ab
I am surprised that no one mentioned the set, which perfectly solved the question.
Using the sismember key value in set, it checks if the value is a member of the key.
Here is the example:
redis 127.0.0.1:6379> SADD myset1 "hello"
(integer) 1
redis 127.0.0.1:6379> SISMEMBER myset1 "hello"
(integer) 1
redis 127.0.0.1:6379> SISMEMBER myset1 "world"
(integer) 0