在 mongoexport 中获取有关 --query 的错误

问题描述

在 node.js 中编写 mongoExport 代码时出错

命令:

var quer_var= `'{"_id.userId":"${userId}","_id.type":"gapAnalysis","_id.timeStamp":"${timeStamp}"}'`
var command = `mongoexport --db ${process.env.DB_NAME} --collection preCaches --query ${quer_var} --type csv --fields MPN,L4Category,RevenueImpact --out ${process.env.DOWNLOAD_DIR_PATH+fileName}`

错误

'{"_id.userId":"5fbf7fd344c67c48085383b1","_id.timeStamp":"2020-12-31T14:30:22+05:30"}'
2020-12-31T14:30:33.019+0530    query '[39 123 95 105 100 46 117 115 101 114 73 100 58 53 102 98 102 55 102 100 51 52 52 99 54 55 99 52 56 48 56 53 51 56 51 98 49 44 95 105 100 46 116 121 112 101 58 103 97 112 65 110 97 108 121 115 105 115 44 95 105 100 46 116 105 109 101 83 116 97 109 112 58 50 48 50 48 45 49 50 45 51 49 84 49 52 58 51 48 58 50 50 43 48 53 58 51 48 125 39]' 
is not valid JSON: json: cannot unmarshal string into Go value of type map[string]interface {}
2020-12-31T14:30:33.022+0530    try 'mongoexport --help' for more information

请帮我解决这个问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)