Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

422
Views
Expecting 'EOF' error when importing a json file in MongoDB

I am trying to import the following json file into MongoDB with Compass but I get an error:

Unexpected token � in JSON at position 0 while parsing near '�' in C:\Users\antoi\Downloads\restaurants.json 

> 1 | �
| ^

Then I tried to test it from another source but it didn't work:

Error: Parse error on line 10:
...s Park Bake Shop"} { "_id": {        "$oid"
----------------------^
Expecting 'EOF', '}', ',', ']', got '{'

is a quotation mark missing? But when I add a quotation mark it gives me:

Error: Parse error on line 10:
...is Park Bake Shop"}, {   "_id": {        "$oi
----------------------^
Expecting 'EOF', got ','
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Use mongoimport

mongoimport --db myDb --collection restaurants --file restaurants.json

restaurants.json is not a valid JSON, not wrapped in array nor it has commas at the end.

https://docs.mongodb.com/manual/reference/mongodb-extended-json/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!