0

I'm importing data from csv file to my MongoDB with mongoimport. In one field I have a phone numbers which start with front 0 (zero) like: 0908566. My mongoimport deletes this zero from data on import. How could I avoid it? I'm using this command

mongoimport --db Terema -c terema_data --type csv --host SOMEIP --port 27017 --username SOMEUSERNAME --password SOMEPASS --authenticationDatabase admin  --file terema.csv --headerline

Marcel Kopera
  • 304
  • 2
  • 9
  • I tried that, but I'm not getting that explanation there, when I try something like ` --headerline --columnsHaveType string()` it throws `syntax error near unexpected token `('` – Marcel Kopera Jun 15 '20 at 08:02
  • does I need explicitly write down all columns in `--fields` because it has a lot of cols.. – Marcel Kopera Jun 15 '20 at 08:05
  • https://stackoverflow.com/questions/24223443/mongoimport-choosing-field-type does this help You? – Hubert Bratek Jun 15 '20 at 08:23

0 Answers0