I have a folder that was generated using mongodump. I would like to run mongorestore to insert the values from this dump into my collection, but without first removing the existing collection. So then after running mongorestore, the collection would contain the union of the original data and the data from the dump.

Of course, if I use mongorestore, I’ll get this error message:

Failed: restore error: timeseries collection<Collection_Name> already exists on the destination. You must remove this collection from the destination or use --drop

But obviously dropping the collection doesn’t help with merging the data sets.

Is it possible to use mongorestore to do this or will I have to write a script to perform this for me? Additional question: If some of the values from the dump are identical to the objects already in the collection, would this cause an error, or would the values just be skipped over?