afloyd / mongo-migrate

MIT License
159 stars 81 forks source link

Replica sets in mongodb > 2.0 #45

Closed mnology closed 8 years ago

mnology commented 9 years ago

Using latest mongodb native(2.0.49) the function for defining Replica set servers seems to have been changed to ReplSet, and is no longer ReplSetServers

node_modules/mongodb-migrate/lib/db.js:22
   return new mongodb.ReplSetServers(replServers);
          ^
TypeError: undefined is not a function
    at getReplicaSetServers (...node_modules/mongodb-migrate/lib/db.js:22:11)
    at Object.getConnection (...node_modules/mongodb-migrate/lib/db.js:31:11)
    at performMigration (...node_modules/mongodb-migrate/index.js:267:6)
    at commands.up (...node_modules/mongodb-migrate/index.js:203:4)
    at runMongoMigrate (...node_modules/mongodb-migrate/index.js:319:10)
    at Object.<anonymous> (...node_modules/mongodb-migrate/index.js:375:2)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
afloyd commented 9 years ago

I don't have any replication sets to test with, but if you submit a pull request I'll merge it

On Fri, Sep 11, 2015, 9:51 PM Erik Johansen notifications@github.com wrote:

Using latest mongodb native(2.0.49) the function for defining Replica set servers seems to have been changed to ReplSet, and is no longer ReplSetServers

node_modules/mongodb-migrate/lib/db.js:22 return new mongodb.ReplSetServers(replServers); ^ TypeError: undefined is not a function at getReplicaSetServers (/Users/Shared/Development/NikeBuild/present/web/node_modules/mongodb-migrate/lib/db.js:22:11) at Object.getConnection (/Users/Shared/Development/NikeBuild/present/web/node_modules/mongodb-migrate/lib/db.js:31:11) at performMigration (/Users/Shared/Development/NikeBuild/present/web/node_modules/mongodb-migrate/index.js:267:6) at commands.up (/Users/Shared/Development/NikeBuild/present/web/node_modules/mongodb-migrate/index.js:203:4) at runMongoMigrate (/Users/Shared/Development/NikeBuild/present/web/node_modules/mongodb-migrate/index.js:319:10) at Object. (/Users/Shared/Development/NikeBuild/present/web/node_modules/mongodb-migrate/index.js:375:2) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12)

— Reply to this email directly or view it on GitHub https://github.com/afloyd/mongo-migrate/issues/45.

beholderrk commented 9 years ago

This PR can allow to avoid problem with ReplSet

akoskm commented 8 years ago

Any chance for this to be merged?

afloyd commented 8 years ago

See #46, the PR had conflicts so I merged as best as possible...