duan89197 2016-06-03 19:09
浏览 21

Mongo Sharred键定义并在GO lang中使用

I have a program where I need to access Mongo Sharred Key from DB collection in Go lang. I retrieve the collection output as

map[string]interface{} 

and type cast Mongo Sharred Key. However sometime its definition is int64 and sometime it is only int. So my Go program is getting panic sating

"invalid interface conversion - interface is defined as int but its type is int64".

And when I change its definition to int64 again I am getting same type error for other records. Please help.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有没有可以帮我搞一个微信建群链接,包括群名称和群资料群头像那种,不会让你白忙
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
    • ¥15 Vue3地图和异步函数使用
    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题