0
mongoimport --db test --collection collection1 --file c:/test.json
我得到了SyntaxError:执行上述命令时出现意外的标识符。SyntaxError:在MongoDB中导入JSON文件时出现意外的标识
这个脚本的问题是什么?
非常感谢您
mongoimport --db test --collection collection1 --file c:/test.json
我得到了SyntaxError:执行上述命令时出现意外的标识符。SyntaxError:在MongoDB中导入JSON文件时出现意外的标识
这个脚本的问题是什么?
非常感谢您
我有同样的问题,当我试图从MongoDB的壳牌导入JSON文件。
您可以从命令提示符查询它。
我的目录stucture:
C:\Program files\MongoDB\Server\3.0\bin\mongoimport.exe
C:\filename.json
例如
C:\Program Files\MongoDB\Server\3.0\bin> ./mongoimport --db dbname --collection collection_name C:\filename.json
输出应该是:
2015-08-18T09:34:25.617-0700 connected to: localhost
2015-08-18T09:34:25.632-0700 imported 10 documents
现在切换回MongoDB的外壳:[导入使用mongimport JSON文件,不断收到\`意想不到的标识符\`的
C:\Program Files\MongoDB\Server\3.0\bin> ./mongo
use dbname
db.collection_name.find().pretty()
可能重复? ](http://stackoverflow.com/questions/16500127/importing-json-file-using-mongimport-keep-getting-unexpected-identifier) – 2015-04-03 17:47:33