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

78
Views
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 answers
Answer question

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 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!