mongoose: Document Update (RESTful)
Für die (Gedächtnis-)Ablage:
// Notes Update (PUT)
app.put('/notes/:id.json', function(req, res) {
Note.update(
{ _id: req.params.id }, // find updatable document by _id
{
text: req.body.text,
starts_at: req.body.starts_at,
due_to: req.body.due_to,
sticky: req.body.sticky
},
function(err) {
if(err) throw(err);
res.send({success: true});
}
);
});