meteor Mongo Schema Migrations Make Sure Field has Specific Value


Example

db.posts.find().forEach(function(doc){
    if(!doc.foo){
        db.posts.update({_id: doc._id}, {$set:{'foo':'bar'}}, false, true);
    }
});