21
all application on unix knowledges by golfreeze / mongodb dump and restore only specific collection or table
« Last post by golfreeze on มีนาคม 11, 2023, 03:36:25 PM »mongodb dump and restore only specific collection or table
database : test123
collection-name : ProductManager
===mongodump only collection
/usr/bin/mongodump -h localhost -d test123 --collection=ProductManager -o /home/test/backup_mongo/
===mongorestore only collection
mongorestore --db=test123 --collection=ProductManager /home/test/backup_mongo/test123/ProductManager.bson
database : test123
collection-name : ProductManager
===mongodump only collection
/usr/bin/mongodump -h localhost -d test123 --collection=ProductManager -o /home/test/backup_mongo/
===mongorestore only collection
mongorestore --db=test123 --collection=ProductManager /home/test/backup_mongo/test123/ProductManager.bson