当前位置:   article > 正文

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

json: cannot unmarshal string into go value of type map[string]interface {}

执行mongoexport命令的时候

  1. 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
  2. 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 {}
  3. 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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/546720
推荐阅读
相关标签
  

闽ICP备14008679号