- Create a temporary collection
- Use the add data to import your data into the temp collection
- Open the mongod console, and run the following line
db.TEMPCOLLECTIONNAME.aggregate([{$merge:{into:{coll:'TARGET COLLECTION NAME',db:'TARGET DB NAME'},on:'_id'}}])
Obviously replace the 3 names. You can leave out the DB property if the temp collection is in the same db as the target.
db.TEMPCOLLECTIONNAME.aggregate([{$merge:{into:{coll:'TARGET COLLECTION NAME'},on:'_id'}}]) db.temp.aggregate([{$merge:{into:{coll:'consultation'},on:'_id'}}])
0 Comments
Post a Comment