0

I have the same collection of documents, found in two different databases. I would like to sum documents from both dbs. How is easiest to do? I need the sum of these sets, the sets are disjoint.

I assume that by using mongoimport, mongorestore but how exactly do you recommend dealing with the problem?

4

1 に答える 1

1

I'd do it with mongodump, yes.

mongodump -d dbA

This will create some files in dump/dbA. Now run this command to import them into another db.

mongorestore -d dbB dump/dbA

You can run mongorestore --help for more info on its parameters.

于 2012-07-12T10:39:03.620 に答える