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

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

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