Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

421
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda