Open raq929 opened 7 years ago
const update = function(id, field, value) { - let modify = {}; + // let modify = {}; - modify[field] = value; + // modify[field] = value; Person.findById(id).then(function(person) { person[field] = value; return person.save(); }).then(function(person) { console.log(person.toJSON()); }).catch(console.error).then(done); };
The modify code is extraneous, but it might be useful to have as a comment about what we're about to do with a person.