Author Topic: mongodb dump and restore only specific collection or table  (Read 1206 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
mongodb dump and restore only specific collection or table
« 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