Problems encountered when importing Json data in MongoDB6.0

question:

Parser cannot parse input: expected a value

Insert image description here

Reason for import failure: Mongoimport Failed: invalid JSON input. Error

Solution: Use mongoimportthe command line tool to import

Official website download mongoimportcommand line tool

  1. Enter the mongodb official website and find the MongoDB Database Tools in tools
  2. Select all the suffix files in the bin directory under the downloaded compressed folder exeand copy them to the MongoDB \ bin directory.

Insert image description here

  1. Next, add options to the original command --legacyand 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

Insert image description here

Guess you like

Origin blog.csdn.net/qq_44721831/article/details/130250658