Tell us what’s happening:
Describe your issue in detail here.
i have no idea what is wrong with my code. The test fails with the message “Creating an instance from a mongoose schema should succeed”. PLEASE help !
Your project link(s)
https://boilerplate-mongomongoose-4.johnjunji.repl.co
here is my code :
const mongoose = require(‘mongoose’);
const Schema = mongoose.Schema;
const personSchema = new Schema({
name: {type: String, required: true, unique: true},
age: Number,
favoriteFoods : [String]
});
const Person = mongoose.model(“Person”, personSchema);
const newGuy = new Person({
name: “John”,
age: 22,
favoriteFoods : [“apple”, “orange”]
});
solution: boilerplate-mongomongoose (4) - Replit
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Challenge: MongoDB and Mongoose - Create a Model
Link to the challenge: