Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

426
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda