(error) ERR wrong number of arguments for 'hmget' command

首先不存在hmgetall这样的命令,

localhost:6379> hgetall people_info

  1. “\xe5\xbc\xa0\xe5\xb0\x8f\xe4\xba\x8c”
  2. “{“age”: 17, “salary”: 100, “address”: “\u5317\u4eac”}”
  3. “\xe7\x8e\x8b\xe5\xb0\x8f\xe4\xb8\x89”
  4. “{“age”: 20, “salary”: 9999, “address”: “\u56db\u5ddd”}”
  5. “\xe5\xbc\xa0\xe5\xb0\x8f\xe5\x9b\x9b”
  6. “{“age”: 30, “salary”: 0, “address”: “\u5c71\u4e1c”}”
  7. “\xe5\x88\x98\xe5\xb0\x8f\xe4\xba\x94”
  8. “{“age”: 24, “salary”: 24, “address”: “\u6cb3\u5317”}”
  9. “\xe5\x91\xa8\xe5\xb0\x8f\xe5\x85\xad”
  10. “{“age”: 56, “salary”: 87, “address”: “\u9999\u6e2f”}”

正确用法如下:
localhost:6379> hmget people_info "\xe5\xbc\xa0\xe5\xb0\x8f\xe4\xba\x8c"

  1. “{“age”: 17, “salary”: 100, “address”: “\u5317\u4eac”}”

或者:
localhost:6379> hmget people_info "张小二"

  1. “{“age”: 17, “salary”: 100, “address”: “\u5317\u4eac”}”

上面加粗的地方是命令

你可能感兴趣的:(Redis)