title: How do you set a boolean value in Redis?
body: <p>When I set a boolean value (<code>true</code>) to a key in Redis, the value is coerced to a string (<code>&quot;true&quot;</code>).  With memcached, I get back what I put in.  But with Redis it seems to stringify everything.  I can't find any docs on how to fix this boolean issue.  No special boolean_set methods or boolean options.</p>
  <p>I'm using Ruby.</p>
  <p>Example follows.</p>
  <p>Set up:</p>
  <pre><code>require 'redis'
  @redis = Redis.new
  </code></pre>
  <p>running in irb:</p>
  <pre><code>irb(main):034:0&gt; bool = true
  =&gt; true
  irb(main):035:0&gt; bool
  =&gt; true
  irb(main):036:0&gt; @redis.set(&quot;example&quot;, bool)
  =&gt; &quot;OK&quot;
  irb(main):037:0&gt; @redis.get(&quot;example&quot;)
  =&gt; &quot;true&quot;
  irb(main):038:0&gt; @redis.get(&quot;example&quot;) == bool
  =&gt; false
  
  </code></pre>