Creating and saving a db item should succeed

Tell us what’s happening:
I just want to pass the part of the module, everyone reaches the same problem!

Your code so far

const createAndSavePerson = function(done) {
  
  let person = new Person({name: 'Fábio',age: 23,favoriteFoods: ['Panelada','Cajuina','Maria Isabel']});
  
  person.save(function(err,data){
    if(err) return console.error(err)
    return done(null,data)
  })

};

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36.

Challenge: Create and Save a Record of a Model

Link to the challenge:

Welcome, fabiobends.

Are you getting any errors in your console? Could you provide the link to your project?

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

Please use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks are not single quotes.

markdown_Forums

1 Like

I know the correct answer! It is just to drop the single quotes for the variable MONGO_URI! That’s it