mongodb - Mongoimport to merge/upsert fields -


i'm trying import , merge multiple csvs mongo, documents getting replaced rather merged.

for example, if have one.csv:

key1, first column, second column 

and two.csv:

key1, third column 

i end with:

key1, first column, second column, third column 

but instead i'm getting:

key1,third column 

currently i'm using:

mongoimport.exe --ftype csv --file first.csv --fields key,firstcolumn,secondcolumn mongoimport.exe --ftype csv --file second.csv --fields key,thirdcolumn --upsert --upsertfields key1 

that's way mongoimport works. there's existing new feature request merge imports, now, you'll have write own import provide merge behavior.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -