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

136
Views
mongoimport ignore field value 0

I have a lot of data in CSV with a lot of fields for which the value is 0.

I would like to import all that data into a collection, but ignore the fields when the value is 0 (not ignore the row, just the fied).

Without ignore the 0 fields, my command is : mongoimport --db merch --collection output --type csv --headerline --file export_hub_dev.csv

Is there any option with mongoimport which permits to do that ? For example something like --parseGrace skipField but with the 0 value ?

Or any other way to do that easily ?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You may first import the csv and then remove the fields by $UNSET. You need to run this for each fields one by one. The update format is

db.collection.update(
   <query>,
   <update>,
   {
     upsert: <boolean>,
     multi: <boolean>,
     writeConcern: <document>,
     collation: <document>
   }
)
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!