【发布时间】:2016-11-29 18:52:16
【问题描述】:
我想更新我的 mongodb 我知道在服务器端写什么,但我不知道如何在客户端以角度使用它。你能帮我吗 ? 这是我的服务器端代码
module.exports.updateUser = function (req, res) {
// get a user with ID of 1
User.findById(1, function(err, user) {
if (err) throw err;
// change the users location
user.location = 'uk';
// save the user
user.save(function(err) {
if (err) throw err;
console.log('User successfully updated!');
});
});
}
【问题讨论】:
标签: javascript angularjs node.js mongodb