0
I have two Mongodb databases that I connect using Mongoose on Nodejs, one with an X collection that references the ID of another Y collection that is in another Mongodb database on another server.
I need to unify the two databases by copying the X collection according to certain criteria for the database containing the Y collection. Keeping the X collection data up to date on both database servers.
How can I transport a Model from one connection to another?
You want to import data from one database to another or use it simultaneously?
– Costamilam
both, both import in order to keep the second updated, when use simultaneously, since in bank 1 will not have the collections Y.
– Delfino
You have two separate servers? You can use the tools like mongodump to save the documents in one file and then import it to the other server using mongorestore.
– Giovanni Nunes
as I said in the question, there are criteria to be considered. And this will be at runtime.
– Delfino