Hi,
When I use mongoimport on a json file, it only imports one document (the first one).
Here is the dos command I'm using:
c:\mongodb\bin\mongoimport --host localhost --db test --collection australiaOceaniaGDPgrowth --type json --file "c:\mongodb\bin\research\test.json"
and there is the test.json file:
{"id":"1","gdp_growthDate":"12\/31\/2019","australia":"2096.67","fiji":"10.544","kiribati":"0.233","new_zealand":"295.931","papua_new_guinea":"71.319","samoa":"1.91","samoan_islands":"13.507","timor_leste":"6.571","tonga":"1.264","tuvalu":"0.049","vanuatu":"112.957"}, {"id":"2","gdp_growthDate":"12\/31\/2018","australia":"1987.33","fiji":"9.95","kiribati":"0.223","new_zealand":"283.287","papua_new_guinea":"66.585","samoa":"1.828","samoan_islands":"12.362","timor_leste":"6.009","tonga":"1.173","tuvalu":"0.047","vanuatu":"105.568"}, {"d":"3","gdp_growthDate":"12\/31\/2017","australia":"1884.82","fiji":"9.392","kiribati":"0.213","new_zealand":"271.747","papua_new_guinea":"62.433","samoa":"1.783","samoan_islands":"11.367","timor_leste":"5.973","tonga":"1.092","tuvalu":"0.046","vanuatu":"98.507"}, {"id":"4","gdp_growthDate":"12\/31\/2016","australia":"1786.02","fiji":"8.868","kiribati":"0.204","new_zealand":"260.913","papua_new_guinea":"58.768","samoa":"1.748","samoan_islands":"10.454","timor_leste":"5.816","tonga":"1.018","tuvalu":"0.044","vanuatu":"91.783"}, {"id":"5","gdp_growthDate":"12\/31\/2015","australia":"1690.45","fiji":"8.376","kiribati":"0.195","new_zealand":"249.58","papua_new_guinea":"55.679","samoa":"1.667","samoan_islands":"9.611","timor_leste":"5.805","tonga":"0.952","tuvalu":"0.042","vanuatu":"85.479"}, {"id":"6","gdp_growthDate":"12\/31\/2014","australia":"1616.45","fiji":"7.911","kiribati":"0.187","new_zealand":"238.233","papua_new_guinea":"39.609","samoa":"1.588","samoan_islands":"8.8","timor_leste":"5.708","tonga":"0.895","tuvalu":"0.041","vanuatu":"79.918"}, {"id":"7","gdp_growthDate":"12\/31\/2013","australia":"1554.35","fiji":"7.409","kiribati":"0.177","new_zealand":"220.991","papua_new_guinea":"34.261","samoa":"1.579","samoan_islands":"8.006","timor_leste":"6.147","tonga":"0.847","tuvalu":"0.04","vanuatu":"75.886"},
It is only returning the top document but as you can see there are 7. I've also tried removing the commas after each }. But it still only imports one document. It puzzles me because there are no error messages.
But there is no problem when I do a similar import on this set which you may recognize from other forums:
{"FirstName": "Bruce", "LastName": "Wayne", "Email": "bwa...@Wayneenterprises.com"}
{"FirstName": "Lucius", "LastName": "Fox", "Email": "lf...@Wayneenterprises.com"}
{"FirstName": "Dick", "LastName": "Grayson", "Email": "dgra...@Wayneenterprises.com"}