Load JSON documents into a collection.
Section: Import and export data
Import JSON data
bash
bash
mongoimport --uri="mongodb://localhost:27017/appdb" --collection=users --file=users.json --jsonArrayExplanation
`--jsonArray` is required when the source file contains one top-level JSON array.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Import and export data