Set Mongoose model instance properties with "extend" util Set Mongoose model instance properties with "extend" util mongoose mongoose

Set Mongoose model instance properties with "extend" util


What you can do is to use Mongoose's update method:

Song.update({    song_id: '123',}, {    $set: {        title: 'changed title',        artist: {            name: 'changed artist',            id: '789',        },    },}, function(err, numAffected) {    ...});

However, I don't actually see why your extend attempt failed. It seems to work for me, I usually use underscore's _.extend function.