ga-wdi-boston / mongoose

An introduction to mongoose
Other
5 stars 136 forks source link

Extraneous code #48

Open raq929 opened 7 years ago

raq929 commented 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);
};
raq929 commented 7 years ago

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.