eolas/neuron/93d3f8b4-f6ce-497f-bc67-2f2b18c283e8/Importing_MongoDB_data.md
2025-01-17 17:51:58 +00:00

492 B

tags
mongo-db
node-js
databases

Importing data to MongoDB

We can use the command line to import data into a Mongo database. We can also combine the importing of data with the creation of a database:

mongoimport --db [preexisting_or_new_database name] --collection [collection_name] --file sourcedata.json --jsonArray

We use --jsonArray to indicate the format of the data we are importing.

Once this has executed, the data will be visible in Compass.