Tell us what’s happening:
The question I have is why are we using .save() . Why not using only .create ?
The question proper is what is difference between using . create an d.save?
Am kinda confused.
Your code so far
Why
var person = new Person( {name: 'Tany', age: 23, favouriteFoods: ['tuna', 'bread'] }); person.save((err, data)=>{ if (err) return done(err) return done(null, data) })
not
person.create( {name: 'Tany', age: 23, favouriteFoods: ['tuna', 'bread'] },(err, data)=>{ if (err){ handle error }else{ blah blah blah } }))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
.
Challenge: Create and Save a Record of a Model
Link to the challenge: