title: @user_script:1: WRONGTYPE Operation against a key holding the wrong kind of value
body: <p>Following is my lua script</p>
  
  <pre><code>if redis.call('sismember',KEYS[1],ARGV[1])==1
  then redis.call('srem',KEYS[1],ARGV[1])
  else return 0
  end
  store = tonumber(redis.call('hget',KEYS[2],'capacity'))
  store = store + 1
  redis.call('hset',KEYS[2],'capacity',store)
  return 1
  </code></pre>
  
  <p>when I run this srcipt in Java, An exception like</p>
  
  <pre><code>@user_script:1: WRONGTYPE Operation against a key holding the wrong kind of value
  </code></pre>
  
  <p>throws, the Java code is like</p>
  
  <pre><code>Object ojb = jedis.evalsha(sha,2,userName.getBytes(),
                  id.getBytes(),id.getBytes()) ;
  </code></pre>
  
  <p>where userName is "tau" and id is "002" in my code,
  and I test the type of "tau" and "002" as follows,</p>
  
  <pre><code>127.0.0.1:6379&gt; type tau
  set
  127.0.0.1:6379&gt; type 002
  hash
  </code></pre>
  
  <p>and exactly, the content of them are :</p>
  
  <pre><code>127.0.0.1:6379&gt; hgetall 002
  name
  "鏁版嵁搴撲粠鍒犲簱鍒拌窇璺?
  teacher
  "taochq"
  capacity
  54
  127.0.0.1:6379&gt; smembers tau
  002
  004
  001
  127.0.0.1:6379&gt;
  </code></pre>
  
  <p>Now I'm so confused and don't know what's wrong, any help will be grateful</p>