make it easier to re-run puzzle migration

pull/2465/head
Thibault Duplessis 2016-12-11 22:20:28 +01:00
parent 6f3b94d944
commit 0c0d06e627
1 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,9 @@ var puzzles = db.puzzle;
modified = 0;
puzzles.find().forEach(function(p) {
puzzles.find({
'vote.ratio': {'$exists': false}
}).forEach(function(p) {
puzzles.update({
_id: p._id
}, {
@ -14,4 +16,4 @@ puzzles.find().forEach(function(p) {
modified += 1;
});
print(modified);
print(modified);