2013-12-23 13 views
-1

나는 이런 사람을 위해 person datas.A line을 보유하고있는 .csv 파일을 가지고있다.mongoimport 필드 이름을 결정하는 방법

"20781","IN","Ms.","Roy","","Serrano","2002-04-16 00:00:00","[email protected]" 

어떻게 mongoimport에 필드 이름을 지정할 수 있습니까?

필드 이름 -> id, type, firstname, middlename, lastname, modifieddate, 전자 메일.

+1

문서에서 다루는 내용은 다음과 같습니다. http://docs.mongodb.org/manual/reference/program/mongoimport/#cmdoption--fields – WiredPrairie

답변

4

당신은 벨로

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

이 하나 개의 문서로 파일을 가져올 것처럼 할 수 있습니다.

+0

@ nish71- 예, 인터넷에서도 발견되었습니다. 도움을 청합니다. – mekafe

+0

np, 감사하겠습니다. – nish71