[SERVER-544] Merge/overwrite collections function Created: 14/Jan/10  Updated: 06/Dec/22  Resolved: 07/Aug/18

Status: Closed
Project: Core Server
Component/s: Usability
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor - P4
Reporter: Phillip Oldham Assignee: Backlog - Query Team (Inactive)
Resolution: Duplicate Votes: 7
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-12280 allow $out to append to/merge with ex... Closed
Related
is related to SERVER-21573 "dropDups" option for updates (includ... Closed
Assigned Teams:
Query
Participants:

 Description   

A very useful feature would be the ability to merge collections together, overwriting/updating the records of one collection with those contained in another.

db.overwriteCollection(destCollection, [srcCollection, ...], options);

where srcCollection is the collection, or an array of collections, to be merged into/onto destCollection.

options:

update: true/false - whether to update (true) or replace (false, default behaviour when not set) any conflicting/existing records based on document id or unique key.
remove: true/false - whether to remove the srcCollection(s) (true) on completion. false by default.



 Comments   
Comment by Nicholas Zolnierz [ 07/Aug/18 ]

Closing this as a duplicate of SERVER-12280, which contains more details on the usage and implementation.

Generated at Thu Feb 08 02:54:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.