Skip to content

Instantly share code, notes, and snippets.

@deveshkumar deveshkumar/4.js
Created Jun 30, 2013

Embed
What would you like to do?
5 Code Signals
app.put('/api/friends/:_id', function (req, res){
return Friends.findById(req.params._id, function (err, friend) {
friend.name = req.body.name;
return friend.save(function (err) {
if (!err) {
console.log("updated friend");
} else {
console.log(err);
}
return res.send(friend);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.