1、同一实例下:
use db_source;
var docs = db_source.collection_souce.find();
use db_target;
docs.forEach({db.collection_target.insert(d)});
2、不同Mongodb实例之间,可以使用mongodump和mongorestore,先备份,后恢复:
mongodump -h host:port -d db_source -c collection_source
mongorestore -h host:port -d db_target -c collection_target dump/collection_source.bson