Mongodb - Mongoimport error invalid character

前端 未结 6 2075
时光取名叫无心
时光取名叫无心 2020-12-19 01:35

I tried to import a simple json file using mongoimport and i get the following error

PER-MacBook-Pro:/AJ$ mongoimport --db test --collection samplePM --file         


        
6条回答
  •  盖世英雄少女心
    2020-12-19 02:19

    The comment about non "UTF-8" characters was helpful.

    It seems like there is a problem with creating json documents using textedit in Mac. I could not find these non UTF-8 characters but i created the same file using vi test.json in mac shell. I pasted the contents, saved the file and used mongoimport. It works now.

    Thanks

提交回复
热议问题