diff --git a/Databases/MongoDB/Complete_example.md b/Databases/MongoDB/Complete_example.md new file mode 100644 index 0000000..e69de29 diff --git a/Databases/MongoDB/Create_database.md b/Databases/MongoDB/Create_database.md index 61755e1..d1f4d24 100644 --- a/Databases/MongoDB/Create_database.md +++ b/Databases/MongoDB/Create_database.md @@ -49,3 +49,5 @@ sudo systemctl start --now mongodb # Remove the current socket rm /tmp/mongodb-27017.sock ``` + +For additional command line utilities you will also need to install `mongodb-tools` from the AUR. \ No newline at end of file diff --git a/Databases/MongoDB/Importing_data.md b/Databases/MongoDB/Importing_data.md index e69de29..e3807b2 100644 --- a/Databases/MongoDB/Importing_data.md +++ b/Databases/MongoDB/Importing_data.md @@ -0,0 +1,18 @@ +--- +tags: +- Databases +- mongo_db +- node-js +--- + +# 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: + +```bash +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.