Weird error thrown even though code is correct

Tell us what’s happening:
So I connected to mongoDB and created the personSchema and model correctly , however i keep getting this persistent error and have no clue how to solve it

Your project link(s)

solution: boilerplate-mongomongoose-2 - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.115 Safari/537.36

Challenge: Create a Model

Link to the challenge:

UPDATE: Solved it by adding quotation marks on mySecret.

went from this =>
mongoose.connect(mySecret, { useNewUrlParser: true, useUnifiedTopology: true });

to this =>
mongoose.connect(‘mySecret’, { useNewUrlParser: true, useUnifiedTopology: true });

so simple :')
Keeping this incase someone goes though it like

mySecret is a variable, not a string.

1 Like

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