我正在尝试按照以下命令将 CSV 文件导入到 MongoDB:
mongoimport -d Northwind -c "employee-territories" --type csv --file "/home/ubuntu/Downloads/northwind-mongo-master/employee-territories.csv" --headerline
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误消息
"Syntax Error: missing ; before statement (shell):1"
Run Code Online (Sandbox Code Playgroud)
为了解决这个错误,我必须mongoimport
在mongoshell
环境之外使用。
所以我只是把 terminal
上
不幸的是,我收到了错误消息
error inserting documents: not authorized on Northwind to execute command { insert: "employee-territories", writeConcern: { getLastError: 1, w: 1 }, ordered: false, $db: "Northwind" }
Run Code Online (Sandbox Code Playgroud)
我的代码有什么问题??请帮忙