jueves, 19 de diciembre de 2024

Migrate data from one collection to other

At the moment there is no command in MongoDB that would do this.
db.<collection_name>.find().forEach(function(d){ db.getSiblingDB('<new_database>')['<collection_name>'].insert(d); });

No hay comentarios:

Publicar un comentario