MongoDB and Mongoose - Create a Model test failed

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)

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/ Safari/537.36

Challenge: MongoDB and Mongoose - Create a Model

Link to the challenge:

You remove the exports below the line

//----- **DO NOT EDIT BELOW THIS LINE** ----------------------------------

I would suggest you keep all the functions as well that are in the starting code.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.