var gameScore = new GameScore();
gameScore.set("score", 1337);
gameScore.set("playerName", "Sean Plott");
gameScore.set("cheatMode", false);
gameScore.save(null, {
success: function(gameScore) {
// Execute any logic that should take place after the object is saved.
alert('New object created with objectId: ' + gameScore.id);
},
error: function(gameScore, error) {
// Execute any logic that should take place if the save fails.
// error is a AV.Error with an error code and description.
alert('Failed to create new object, with error code: ' + error.message);
}
});
云代码使用 JavascriptSDK 操作即可。
文档如下:
https://leancloud.cn/docs/js_guide.html#保存对象