meteor Mongo Schema Migrations Blob Record From One Collection Into Another Collection (ie. Remove Join & Flatten)


Example

db.posts.find().forEach(function(doc){
    if(doc.commentsBlobId){
        var commentsBlob = db.comments.findOne({'_id': commentsBlobId });
        db.posts.update({_id: doc._id}, {$set:{'comments': commentsBlob }}, false, true);
    }
});