Tell us what’s happening:
Hi there. Thanks for taking the time to read this. I’m on the “MongoDB and Mongoose - Create a Model” challenge and from what I can tell, by testing my code and reading the docs, everything is right but I’ve clearly missed something as my code won’t pass the fCC tests.
Your code so far
The code I’ve written so far as -
const mongoose = require(‘mongoose’);
const { Schema } = mongoose;mongoose.connect(process.env.MONGO_URI, { useNewUrlParser: true, useUnifiedTopology: true});
const personSchema = new Schema({
name: { type: String, required: true },
age: Number,
favouriteFoods: [String]
});const Person = mongoose.model(‘Person’, personSchema);
I’ve written the code in Glitch which can be found here.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
.
Challenge: Create a Model
Link to the challenge: