-1
我想更新我的mongodb我知道在服務器端寫什麼,但我不知道如何在角度上在客戶端使用它。你能幫我嗎 ? 這裏是我的服務器端代碼更新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!');
});
});
}
10q爲你的迴應。你能解釋一下腳本是什麼嗎? –
在腳本標記我創建了一個角度的應用程序模塊,我打電話給一個http休息api調用(/用戶/保存) –
什麼是$ scope.SendData的使用和我如何傳遞參數,如ID –