afloyd / mongo-migrate

MIT License
159 stars 81 forks source link

Does this migration library support replication? #21

Closed mtrienis closed 8 years ago

mtrienis commented 9 years ago

If I have a primary and secondary node, can I just pass both of the host names? For example,

{
    "mongoAppDb"        : {
        "host" : "mongo-host1, mongo-host2",
        "db"   : "db_name",
        "port" : "27017",
        "username" : "username",
        "password" : "password"
    }
}

Will the driver be smart enough to find the primary node when executing the migrations?

afloyd commented 9 years ago

I don't believe that it will handle this situation, but you can give it a try and see. The method in code that handles host selection is in https://github.com/afloyd/mongo-migrate/blob/master/lib/db.js, method "getConnection"

akoskm commented 8 years ago

This is probably a duplicate of https://github.com/afloyd/mongo-migrate/issues/45