title: Saving a HASH to Redis on a rails app
body: <p>Im just starting off with Redis with Rails so this maybe a dumb question.</p>
  
  <p>I am trying to save a hash to redis server but when I retrieve it its just a string IE.</p>
  
  <pre><code>hash = {"field" =&gt; "value", "field2" =&gt; "value2"}
  $redis.set('data', hash)
  
  #So collecting the data
  @data = $redis.get('data')
  </code></pre>
  
  <p>This is obviously wrong as its returning as a string.</p>
  
  <p>I have also tried looping some results and using the hset ie.</p>
  
  <pre><code>@data.each do |d|
    $redis.hset('data', d.field, d.value)
  end
  
  # errror
  # ERR Operation against a key holding the wrong kind of value
  </code></pre>
  
  <p>Not sure where to go. I have deleted the key $redis.del('data') to make sure that was not the issue. </p>
  
  <p>Hope you can advise, Lee</p>