Answers for "mongo dump json"

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
1

mongoexport csv with query

mongoexport -d database -c collection --type=csv --out file.csv --fields name,fromHour,fromMin,toHour,toMin --query '{"_id":"56a647bff167043ad6ee49c0"}'
Posted by: Guest on August-16-2020

Browse Popular Code Answers by Language