I am looking for some examples of getting and setting string arrays, and I cannot find it or make it work.
The strings themselves are SecureRandom.hex values. Think of them as invitation codes. I want to create a key / value pair:
1) Key=> invite:code:88bb4bdfef Value=> userid
2) Key=> userid:invite:codes Value => 88bb4bdfef,73dbfac453,etc... (one entry for each of the previous sets)
I just get hung up on managing the values ββin the second key / value pair.
UPDATE: Therefore, the task is that if I create an array and set it like this:
foo=Array.new foo.push("abc") foo.push("def")
at this moment foo looks like this: ["A", "DEF"]
So, I installed foo in redis to restore it:
$redis.set(:foo,foo) bar=$redis.get(:foo)
Now the panel looks like this: "[\" A \ "\" Protection \ "]"
source share