Closed Daxcor69 closed 1 year ago
Here my code:
const options = { host: [ { host: mongo1-dev.local, port: 27017 }, { host: mongo2-dev.local, port: 27017 }, { host: mongo3-dev.local, port: 27017 }, ], replicaSetName: "rs0", srv: false, username: "backup", password: "backup", outDir: `./backup/${dateString}`, auhenticationDatabase: "found_dev", authenticationMechanism: "SCRAM-SHA-256", all: true, }; await mongoExport(options);
The process errors out with the following:
uri: 'mongodb://backup:backup@mongo1-dev.local:27017,mongo2-dev.local:27017,mongo3-dev.local:27017/?authMechanism=SCRAM-SHA-256', options: { replicaSet: 'rs0' }, triggerError: MongoServerError: Authentication failed.
As you can see in the connection string there is no auth db spec in the uri.
nm spelling mistake in the authentication
Here my code:
The process errors out with the following:
As you can see in the connection string there is no auth db spec in the uri.