Skip to content

Instantly share code, notes, and snippets.

@omeroot
Last active December 29, 2015 09:47
Show Gist options
  • Select an option

  • Save omeroot/29ff196f1aeb11e3de7d to your computer and use it in GitHub Desktop.

Select an option

Save omeroot/29ff196f1aeb11e3de7d to your computer and use it in GitHub Desktop.
YOURMODEL
{
_id
process : [{
_id : //mongo generate automatic
title : {type: Schema.Types.Mixed, default: {}},
description : {type: Schema.Types.Mixed, default: {}},
image : {type: String},
order : {type: Number}
}]
}
----------------
YOURMODEL.update({_id: "564f333694a7b47c1dd9bb20", 'process._id': "564f333794a7b47c1dd9bb21"},
{$set:{ 'process.$.title': 'omer test' }} ,function(err, res){
console.log(err, res);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment