Mongoimport ignore leading zero in csv
问题 I have a .CSV export file from a SQL Server database, with a phone number field (number type) that field values started with leading zero. Leading zero is presented in the CSV file. When I attempt to mongoimport it to DB (in string type) I find data imported without leading zero. The target field number is string. How can I solve this problem? 回答1: you can specifically define the type of the field using the import option --columnsHaveTypes Instructs mongoimport that the field list specified