mongoDB mongoimport upsert

允我心安 提交于 2019-12-04 11:26:37

Your mongoimport command is missing the --upsert option, which is needed in combination with --upsertFields. Try:

mongoimport -d my_db -c db_collection --upsert --upsertFields email ~/Desktop/update_list.csv

Add --type csv

Otherwise it assumes your input is json.

Also, looks like you should pass --headerline to make it use the first line of the file as a header.

I assume that the data inside your CSV file must be double-quoted.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!