문제

i have a .csv file that holds person datas.A line for a person like this.

"20781","IN","Ms.","Roy","","Serrano","2002-04-16 00:00:00","20781@adventure-works.com"

How can i give field names to mongoimport?

Field names -> id,type,firstname,middlename,lastname,modifieddate,e-mail.

도움이 되었습니까?

해결책

you can do like Bellow

mongoimport -d test -c person -type csv --file person.csv --fields "id,type,firstname,middlename,lastname,modifieddate,e-mail"

this will import your file as in one document.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top