I have this code based on a mongodb connection example, I am trying to insert an object. but getting and error on the insertone line
This is the error data: MongoDB.Driver.MongoAuthenticationException: 'Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1.' Inner MongoCommandException: Command saslContinue failed: bad auth Authentication failed..
I am new using mongodb and got no idea of what is the error reason. Any help
static void Main(string[] args)
{
MongoClient dbClient = new MongoClient("mongodb+srv://dbUser:dbPass001@cluster0-pfry9.mongodb.net/test?retryWrites=true&w=majority");
var database = dbClient.GetDatabase("test");
var collection = database.GetCollection<anyClassTest>("entities");
var r = new anyClassTest() { name="Original", edad = 36, id = 1};
collection.InsertOne(r);
}
public class anyClassTest
{
public string name { get; set; }
public int edad { get; set; }
public int id { get; set; }
}