title: How to store integer values in redis cache?
body: <p>I am using redis cache for storing data to be cached. The type of data to be stored as key, is of numerical type. The value is automatically coerced to string type by redis.</p>
  
  <pre><code>127.0.0.1:6379&gt; sismember def 34
  (integer) 1
  127.0.0.1:6379&gt; sismember def 34.
  (integer) 0
  127.0.0.1:6379&gt; sismember def 34.0
  (integer) 0
  127.0.0.1:6379&gt; sismember def 3.4
  (integer) 1
  127.0.0.1:6379&gt; smembers def 34.0
  (error) ERR wrong number of arguments for 'smembers' command
  127.0.0.1:6379&gt; sadd  def 34.0
  (integer) 1
  127.0.0.1:6379&gt; smembers def
  1) "34"
  2) "34.0"
  3) "3.4"
  </code></pre>
  
  <p>I know that this question related to the one I am asking is already asked at <a href="https://stackoverflow.com/questions/32274113/difference-between-storing-integers-and-strings-in-redis">Difference between storing Integers and Strings in Redis</a>, but it doesn't have satisfactory answer. </p>
  
  <p>So, my question is that doesn't redis support storing integers as key, although they are immutable ? Is there any performance/architectural reason for now allowing non-str immutable values as keys in redis.</p>
  
  <p>Thanks in advance.</p>