Bulk Edit Document Data from String to Float

If I may add to @Prasad_Saya solution, here is what I like to do in bulk situation like yours.

Rather than updating the source collection, I use https://docs.mongodb.com/manual/reference/operator/aggregation/out/ to store the results into a temporary collection. Once I am happy that I get the results I really wanted I just swap the source collection with the temporary results. This way if I screw up it is easier to do any correction. Otherwise, if the source collection is corrupted, you would need to upload it from backup.

1 Like