执行mongoexport命令的时候

mongoexport --csv -f externalSeqNum,paymentId --host 127.0.0.1:27017 -d liveX -c consume_history -o 0531bill.csv -q '{"consumeStatus":"SUCCESS","externalSeqNum":/^201705/}'

报了异常

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

相关文章:

  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2022-01-15
猜你喜欢
  • 2022-02-05
  • 2022-12-23
  • 2022-02-01
  • 2021-05-24
  • 2022-02-24
  • 2021-08-21
相关资源
相似解决方案