Im new to mongodb, can someone explain to me how can i authenticate using SCRAM?
I tried writing to the database, but it returned this error: UnhandledPromiseRejectionWarning: MongoServerError: (Unauthorized) not authorized on admin to execute command
This is my code for the client:
const { MongoClient, ServerApiVersion } = require('mongodb');
const uri = "mongodb+srv://QuackDev:" + password + "@rocketer.iolndfg.mongodb.net/?retryWrites=true&w=majority";
const client = new MongoClient(uri, {
serverApi: {
version: ServerApiVersion.v1,
strict: true,
deprecationErrors: true,
}
});
Am i doing something wrongly?