Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Created by Guest
Created on Nov 12, 2020

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.
  • Attach files