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

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

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