<commit_before>var puzzles = db.puzzle;

modified = 0;

puzzles.find().forEach(function(p) {
  puzzles.update({
    _id: p._id
  }, {
    $set: {
      vote: {
        enabled: (p.vote.up * 3 > p.vote.down) || (p.vote.up + p.vote.down < 50),
        up: p.vote.up,
        down: p.vote.down
      }
    }
  });
  modified += 1;
});

print(modified);<commit_msg>finish fixing puzzle migration<commit_after>var puzzles = db.puzzle;

modified = 0;

puzzles.find().forEach(function(p) {
  puzzles.update({
    _id: p._id
  }, {
    $set: {
      "vote.enabled": (p.vote.up * 3 > p.vote.down) || (p.vote.up + p.vote.down < 50)
    }
  });
  modified += 1;
});

print(modified);
{'fraction_non_alphanumeric': 0.19642857142857142, 'fraction_numerical': 0.01488095238095238, 'mean_word_length': 2.398989898989899, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5552031', 'n_tokens_mistral': 282, 'n_tokens_neox': 265, 'n_words': 47}