import mongodb code example
Example 1: how to import a file from ones directory into mongodb
mongoimport --db test --collection inventory ^
--authenticationDatabase admin --username <user> --password <password> ^
--drop --file ~\downloads\inventory.crud.json
Example 2: import data to mongodb
mongoimport --jsonArray --db YourDatabase --collection YourCollection --file Yourfile.json
Example 3: mongodb import
mongodump -h <127.0.0.1>:<27017> -d <db> -u <user> -p <pw> -o ./
mongorestore ./