Meteor の Leaderboard の例を試していますが、プレイヤーのスコアをランダム化しようとするとバグが発生します。
私がヒットしている例外はException while simulating the effect of invoking '/players/update' undefined
関連するコードは次のようになります。
'click input.randomize_scores': function () {
Players.find().forEach(function (player) {
random_score = Math.floor(Math.random()*10)*5;
Players.update(player, {$set: {score: random_score}})
});
}
ここでかなりばかげたことをしているような気がします。ポインタをいただければ幸いです。