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

81
Vistas
MongoDB import CSV ignoring errors

Is it possible to import data from CSV into mongoDB using mongoimport, but ignoring any errors during parsing csv row? I have a csv file with about 200 millions of rows, and some of them are incorrectly formatted, and each iteration of fix/try takes a lot of time.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Use --parseGrace skipRow option.

mongoimport --type csv --parseGrace skipRow --file millionrecords.csv --headerline

--parseGrace grace

Default: stop

New in version 3.4.

Specifies how mongoimport handles type coercion failures when importing CSV or TSV files with --columnsHaveTypes.

--parseGrace has no effect when importing JSON documents.

  • autoCast : Assigns a type based on the value of the field. For example, if a field is defined as a double and the value for that field was "foo", mongoimport would make that field value a string type.
  • skipField : For the row being imported, mongoimport does not include the field whose type does not match the expected type.
  • skipRow : mongoimport does not import rows containing a value whose type does not match the expected type.
  • stop : mongoimport returns an error that ends the import.
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