Answer the question
In order to leave comments, you need to log in
How to add (merge) the mongo base?
Good day, colleagues! We had an incident - they changed servers and forgot to transfer the www domain to a new IP (I don’t know why there was no CNAME there, I don’t have time to figure it out). It's been 10 days and we've got a handful of users who registered on the old server (they haven't managed to cut it down yet). So we have 2 bases. You need to merge them (namely, merge them so that if _id is already in the database, then the record is not touched. Any options?
PS: it’s hard to do it manually, there are a lot of collections, and it’s not possible to make a selection by time everywhere.
Answer the question
In order to leave comments, you need to log in
I would write a script that will read the old database and add it to the new one if there is no record there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question