db.posts.find().forEach(function(doc){ if(doc.oldfield){ // the false, true at the end refers to $upsert, and $multi, respectively db.accounts.update({_id: doc._id}, {$unset: {'oldfield': "" }}, false, true); } });