Created
August 22, 2014 01:00
-
-
Save YutaWatanabe/c2e89fc124b14195e79a to your computer and use it in GitHub Desktop.
Update the created item in Azure Mobile Service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
// MobileServiceClient のインスタンスを作成 | |
// URL, KEY は管理画面に表示されているものを貼り付け | |
var client = new WindowsAzure.MobileServiceClient( | |
"URL", | |
"KEY" | |
); | |
// Item テーブルのインスタンス取得 | |
var itemTable = client.getTable("Item"); | |
// Item テーブルに項目追加 | |
itemTable.insert({ text:"Sample Item"}) | |
.then(function(item){ | |
//新しく追加した項目の id を取得 | |
var itemId = item.id; | |
// id が itemId な項目の text を "Updated Item" に変更 | |
itemTable.update({ | |
id: itemId, | |
text: "Updated Item" | |
}); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment