Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

import and export data in mongodb

1) mongodump (export)
    all database
       $ mongodump
     single database
       $ mongodump -d databaseName
     single collection
       $ mongodump -d databasename -c collectionName

2) mongorestore (import)
     mongorestore -d databaseName /path/
     mongorestore -d databaseName -c collectionName
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #import #export #data #mongodb
ADD COMMENT
Topic
Name
5+7 =