Mongodb 如何为mongo编写shell脚本?
帮帮我, 我需要为mongo编写shell脚本 代码::Mongodb 如何为mongo编写shell脚本?,mongodb,shell,aggregation-framework,Mongodb,Shell,Aggregation Framework,帮帮我, 我需要为mongo编写shell脚本 代码:: mongo数据--eval“db.collection1.aggregate({$lookup:{from:“collection2”、localField:“id”、foreignField:“id”、as:“arrCol”})” 但是返回错误 SyntaxError:无效的属性id@(shell eval):1:36脚本片段不应包含双引号。查询中的字符串应使用单引号: mongo数据--eval“db.collection1.aggr
mongo数据--eval“db.collection1.aggregate({$lookup:{from:“collection2”、localField:“id”、foreignField:“id”、as:“arrCol”})”
但是返回错误
SyntaxError:无效的属性id@(shell eval):1:36脚本片段不应包含双引号。查询中的字符串应使用单引号: mongo数据--eval“db.collection1.aggregate({$lookup:{from: 'collection2',localField:'id',foreignField:'id',as:'arrCol' }})" 否则,
“db.collection1.aggregate({$lookup:{from:”
将作为您正在传递的JavaScript片段进行复制