eolas/neuron/6d4cfb04-1e87-477a-91e9-34c360bfb8ad/Importing_MongoDB_data.md
2025-03-27 19:06:04 +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.