Hello @Miguel_Escamilla, the
$merge aggregation stage allows incorporating the aggregation’s output into another collection. This will be a complete server side operation - which is efficient. Also, the aggregation stages allow any required data transformation before it can be merged. The merge has options like “whenMatched” and “whenNotMatched” - which are useful to customize the merge operation.
You can also export from one collection into a JSON/CSV and import back into another collection - using
mongoimport command-line tools. Another option is to write a custom application program using your favorite driver (e.g., Java, NodeJS, etc.) to do the merge process.