kysely / mongodb-atlas-backup

The human way to mongodump and mongorestore your MongoDB Atlas cluster
MIT License
31 stars 13 forks source link

MongoBackup is not a constructor #3

Open 3omar3allam opened 5 years ago

3omar3allam commented 5 years ago

I get this error whenever I run this on NodeJS

TypeError: MongoBackup is not a constructor

My code:

const MongoBackup = require('mongodb-atlas-backup');
var backup = new MongoBackup({
    user: <USER>,
    password: <PASSWORD>,
    replicaSet: <REPLICA SET>
});
backup.dump();
PTaylour commented 4 years ago

Try:

const MongoBackup = require('mongodb-atlas-backup').default;
ankurvr commented 4 years ago

The suggested solution worked. Issue can be closed now.