Answers for "how to export mongodb database script"

6

mongodb export entire database

// EXPORT
mongodump -d <database_name> -o <directory_backup>
// IMPORT
mongorestore -d <database_name> <directory_backup>
Posted by: Guest on May-26-2020
0

how to export mongodb database to json

sudo mongoexport --db newdb -c restaurants --out newdbexport.json
Posted by: Guest on August-09-2020
2

mongodb export

mongodump -h <127.0.0.1>:<27017> -d <db> -u <user> -p <pw> -o ./
mongorestore ./
Posted by: Guest on May-24-2021
-1

how to export mongodb database

Mongo Export/dump
mongodump --out </path> --db <dbName> --host <hostname:portNo> --authenticationDatabase admin --ssl --username <Remote Db User> --password<Remote Db Password>
Example:
mongodump --out ~/Desktop/mongoData/ --db newdata --host cluster0-shard-01-02.xyz.mongodb.net:27017  --authenticationDatabase admin --ssl --username abc --password xyz

Mongo Import/restore
mongorestore </path> --db <dbName> --host <hostname:portNo> --authenticationDatabase admin --ssl --username <Remote Db User> --password<Remote Db Password>
Example:
mongorestore ~/Desktop/mongobkup/ --host cluster0-shard-00-02.xyz.mongodb.net:27017  --authenticationDatabase admin --ssl --username abc --password xyz
Posted by: Guest on August-09-2020

Code answers related to "how to export mongodb database script"

Browse Popular Code Answers by Language