使用 telnet 我输入这样的命令行命令
get field with spaces
get "field with spaces"
get 'field with spaces'
这三个都返回相同的错误。
-ERR wrong number of arguments for 'get' command
最佳答案
你用的是什么版本的redis?使用双引号在 2.2.2 上对我来说效果很好
root@this:~# redis-cli
redis> set "test space" hello
OK
redis> get "test space"
"hello"
redis> get 'test space'
(error) ERR wrong number of arguments for 'get' command
redis>
关于redis - 如何使用包含空格的键从 Redis 获取值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6122851/