创建一个bat文件 在其中输入以下3行
第1行进入工具mongodump所在的目录
第2行 将Adam数据库里面的
第3行 将上面存在C:DataDumpAdam文件夹里面的TBLQuickStart.bson 文件保存到TBLQuickStartBackup集合中,并且清空上次的数据
重点是:C:DataDumpAdamTBLQuickStart.bson 很多资料里面都写得是文件夹路径 实际要写文件路劲
cd C:Program FilesMongoDBServer4.0in
mongodump -d Adam -c TBLQuickStart -o C:DataDump
mongorestore -d Adam -c TBLQuickStartBackup --drop C:DataDumpAdamTBLQuickStart.bson