How to copy a collection from one database to another in MongoDB
use sourcedatabase; var docs=db.sourcetable.find(); use targetdatabase; docs.forEach(function(doc) { db.targettable.insert(doc); }); ESTA ES MÁS RÁPIDA (FASTEST!) db.sourcecollection.aggregate([{$out : «targetcollection»}]);