我必須更新parse.com上的表中的多個記錄。它涉及將消息狀態從未讀取更改爲在多個記錄中讀取。 這是更新單個記錄的示例。更新1個查詢調用中的多個行。 Parse.com
PFQuery *query = [PFQuery queryWithClassName:@"GameScore"];
// Retrieve the object by id
[query getObjectInBackgroundWithId:@"xWMyZ4YEGZ" block:^(PFObject *gameScore, NSError *error) {
// Now let's update it with some new data. In this case, only cheatMode and score
// will get sent to the cloud. playerName hasn't changed.
[gameScore setObject:[NSNumber numberWithBool:YES] forKey:@"cheatMode"];
[gameScore setObject:[NSNumber numberWithInt:1338] forKey:@"score"];
[gameScore saveInBackground];
}];
如何更新多個記錄?
更多的澄清,我必須執行的查詢是這樣的: 更新表名SET messageStatus = '讀' 其中userid = 'someId'
任何幫助嗎?
此雲代碼是否適用於IOS?其實我想要從ios的代碼更新行。這是可行的嗎? – stackNeverFlow
您可以從ios設備調用雲代碼。 – vlio20
感謝您的幫助,我會檢查您的建議,但我正在尋找查詢或其他方式,我可以一次更新記錄,與我們在SQL查詢中一樣。 – stackNeverFlow