mongoimport should assume json with arrays
When running something like "mongoimport --host Cluster0-shard-0/cluster0-shard-00-00-MY.mongodb.net:27017,cluster0-shard-00-01-MY.mongodb.net:27017,cluster0-shard-00-02-MY.mongodb.net:27017 --ssl --username MYUSER --password MYPASS --authenticationDatabase admin --db db --collection coll --type json --file D:\downloads\records.json". You get error "2019-09-28T15:40:34.076-0600 Failed: cannot decode array into a D". You have to use the "--jsonArray". Why wouldn't this be the default. Almost all JSON objects have arrays via mass import/export. Worse case, it should give a better error message.
1
vote
Albert
shared this idea