Tell us what’s happening:
Hi! I am doing the ** MongoDB and Mongoose - Create a Model** challenge, And I am not sure why it is not passing, I will share with you my code. I am not sure if it is a problem with my code, or with my DB connection. There is a console log telling me that the Auth authentication failed, But I am placing my password and db name on the .env file.
I would appreciate if someone can help me with this.
Thank you.
Your code so far
var personhandler = function(done) {
const Schema = mongoose.Schema;
const schemaPerson = new Schema({
name: {type: String, required: true},
age: Number,
favoriteFoods: [String]
});
const Person = mongoose.model(“Person”, schemaPerson);
if(error) return done(error);
done(null, result);
};
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
.
Challenge: Create a Model
Link to the challenge: