hash - 我的 redis “ERR 未知命令 'HSTRLEN'”怎么了?
问题描述
1)127.0.0.1:6379> HMSET myhash f1 helloword f2 99 f3 -256
OK
127.0.0.1:6379> HGETALL myhash
2) "f1"
3) "helloword"
4) "f2"
5) "99"
6) "f3"
7) "-256"
127.0.0.1:6379> HSTRLEN myhash f1
(error) ERR unknown command 'HSTRLEN'
127.0.0.1:6379>
但这是官方的例子,HSTRLEN key field what's wearg??
解决方案
在这里发现自己,发现这是一个版本问题:
https://redis.io/commands/hstrlen 自 3.2.0 起可用。
在 Ubuntu 16.04 上:
$ redis-server --version
Redis server v=3.0.6
$ sudo apt search redis-server
redis-server/xenial-updates,xenial-security,now 2:3.0.6-1ubuntu0.3 amd64 [installed]
我的解决方案是在 docker 中运行更高版本。
推荐阅读
- powershell - 使用 Skype 为 MS BOT 创建应用程序端点以进行业务和本地交换
- hive - 整个配置单元文件 (hive -f) 在一个错误查询上执行失败
- asp.net-core - Startup.cs 没有得到更新的 appsettings.json 值 asp.net core
- jquery - 根据屏幕尺寸更改 jquery
- r - 如何从 rmarkdown 创建 pdf,其中可以选择和复制图像
- oracle - 如何在已经有 Oracle 数据库的机器上安装 WebLogic
- docker - Cassandra alpine 图像发布计划?
- java - Docker 错误:无法找到或加载主类 Main.Main
- javascript - 更新用户信息
- java - 使用 Java Streams 从嵌套列表创建 TreeMap