Import a data base file.json into robo3T (robomongo) Import a data base file.json into robo3T (robomongo) mongodb mongodb

Import a data base file.json into robo3T (robomongo)


to import data for a collection in Robomongo:

  1. Right click on collection.
  2. Select 'insert Document'.
    enter image description here
  3. Paste your json data
  4. Click validate.
  5. Click save.


Ok, I found the answer. In shell Mac OS X or Unix type:

$ mongoimport -d your Database Name -c your Collection Name --file /path/to/my/fileThatIwantToImport.json


For anyone wishing to use mongoimport with a remote db (@andi-giga), here's what I did to make it work:

mongoimport -h  xxx.mlab.com --port 2700  -d db_name -c collection_name -u user_name -p password  --type json --file  /Path/to/file.json

Arguments should be self-explanatory.

-h hostname

More information at this link