is not valid JSON: json: cannot unmarshal string into Go value of type map[string]interface

执行mongoexport命令的时候

D:\Program Files\MongoDB\Server\4.0\bin>mongoexport.exe -h localhost:27001 -d mldn -c emps -q '{age:{$gt:20}}' -f name,age,job,salary --type=csv > emps1.csv
2018-09-10T10:49:06.005+0800    error validating settings: query '[39 123 97 103 101 58 123 36 103 116 58 50 48 125 125 39]' is not valid JSON: json: cannot unmarshal string into Go value of type map[string]interface {}
2018-09-10T10:49:06.015+0800    try 'mongoexport --help' for more information

报了异常

is not valid JSON: json: cannot unmarshal string into Go value of type map[string]interface

去掉-q和过滤条件是没有问题的,那么问题就出在过滤条件上

后来发现是window和linux的区别,linux上执行是外面包单引号,window要外面包双引号

window写错:"{'consumeStatus':'SUCCESS','externalSeqNum':/^201705/}" 就没有问题了

版权声明:本文转载自https://blog.csdn.net/dzl84394/article/details/72879795

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值