question:
Parser cannot parse input: expected a value
Reason for import failure: Mongoimport Failed: invalid JSON input. Error
Solution: Use mongoimport
the command line tool to import
Official website download mongoimport
command line tool
- Enter the mongodb official website and find the MongoDB Database Tools in tools
- Select all the suffix files in the bin directory under the downloaded compressed folder
exe
and copy them to the MongoDB \ bin directory.
- Next, add options to the original command
--legacy
and execute it again:
mongoimport --legacy --db=cartoon --collection=bookss --file=L:\百度网盘\ctapp\数据库素材\bookss.json
mongoimport --legacy --db=cartoon --collection=articlesAll --file=L:\百度网盘\ctapp\数据库素材\articlesAll.json