【发布时间】:2014-09-24 16:34:45
【问题描述】:
我对 parse javascript SDK 中的这段代码有点困惑。
// Create the object.
var GameScore = Parse.Object.extend("GameScore");
var gameScore = new GameScore();
gameScore.set("score", 1337);
gameScore.set("playerName", "Sean Plott");
gameScore.set("cheatMode", false);
gameScore.set("skills", ["pwnage", "flying"]);
gameScore.save(null, {
success: function(gameScore) {
// 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.set("cheatMode", true);
gameScore.set("score", 1338);
gameScore.save();
}
});
有人可以解释为什么它会节省两次吗? https://parse.com/docs/js_guide#objects-updating
[编辑] 为了清楚起见,我知道有两个调用 .save();
我想知道为什么这段直接来自 parse Javascript SDK 的代码会保存两次。有好处还是这是一个错误?我不确定..
【问题讨论】:
标签: javascript object parse-platform save