如题。由于数据结构变更,进行数据迁移,怎样将一个数据库里的某个 collection 复制到另一个数据库里。
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
db.copyDatabase(fromdb, todb, fromhost, username, password)
http://docs.mongodb.org/manual/reference/method/db.copyDatabase/
In the mongodb package you downloaded, there are mongoexport and mongoimport. These two programs are available, one is for backup and the other is for import. Or mongodump and mongorestore can also be used.
http://docs.mongodb.org/manual/reference/method/db.copyDatabase/
In the mongodb package you downloaded, there are mongoexport and mongoimport. These two programs are available, one is for backup and the other is for import. Or mongodump and mongorestore can also be used.