I’m trying to copy 4 collections from one Mongo database to another on the same machine from C# program automatically. How do I do that? Is there a simple copy collection/database command in MongoDB C# driver? or do I have to use the Mongo shell by first typing the ./mongo? If so how do I do that inside a MS-DOS command line window? Like ./mongo -copycollection from to?
I’m trying to copy 4 collections from one Mongo database to another on the
Share
Use mongodump, Type:
and then mongorestore:
Read more: mongodump and mongorestore