DDCODE

Share programming skills from Magic Oriental

How to copy the collection from MongoDB database to another MongoDB database

 May 12, 2019   mongodb, question

As the topic is. Due to the change of data structure, how to copy a collection from one database to another database during data migration?

db.copyDatabase(fromdb, todb, fromhost, username, password)

http://docs.mongodb.org/manual/reference/method/db.copyDatabase/

<< How do I find it based on nested attribute values (the first attribute value is an array)? On the combination of mongodb and elasticsearch >>

Powered by MyWiki WordPress Theme