node.js - Protobuf3:如何将 Map Uint64 与 [jstype = JS_STRING] 一起使用
问题描述
我的原型:(AttributeResult 是消息)
message xResponse
{
map < uint64, AttributeResult > attributes = 1;
}
我使用 nodejs 14.x
"google-proto-files": "^2.4.0",
"google-protobuf": "^3.15.6",
"protocol-buffers": "^4.2.0"
我需要将长整数映射为映射中的键,但我不能在映射定义中使用 [jstype = JS_STRING],因为当我尝试生成 .js 文件时,我得到:x_messages.proto:59:3: jstype 只允许在 int64、uint64、sint64、fixed64 或 sfixed64 字段上使用。
无论如何,我可以使用 long 作为我的地图的键吗?谢谢你!
解决方案
推荐阅读
- python-3.x - LSTM - 进行预测时输入中的 Matmul 错误
- python - Python NxN 矩阵未正确设置无值
- sql - 查找来自 X 个国家/地区的前 3 个最订购的类别;以及该国家第二类订单最多的城市
- java - Stream reduction inner Elements
- java - 以下循环迭代多少次?
- laravel - 生产时未收到来自 Sonos 的回调
- node.js - Can not Uninstall nodejs package
- angular - 我的 angularfire 应用程序上没有显示数据
- unit-testing - 如何解决 vuex 和单元测试的问题?
- reactjs - 为什么列表不呈现?