I am facing an issue while submitting the solution of " MongoDB and Mongoose - Create a Model" challenge. I am getting this error: Creating an instance from a mongoose schema should succeed
Your code so far
Here are my codes:
let mongoose = require('mongoose')
mongoose.connect(uri, { useNewUrlParser: true, useUnifiedTopology: true });
let personSchema = new mongoose.Schema({
name: {type: String, required: true},
age: Number,
favoriteFoods: [String]
});
let Person = mongoose.model('Person', personSchema);
I don’t see any error at Glitch. But when I try to submit the solution to FreeCodeCamp, I am getting the error. I tried to use the solutions of other similar questions at the forum. But they didn’t work for me.