Created
May 14, 2013 03:12
-
-
Save tdbrian/5573398 to your computer and use it in GitHub Desktop.
Converts all MongoDB fields in a collection from number to string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.portals.find( { 'pid' : { $type : 1 } } ).forEach( function (x) { | |
x.pid = x.pid += ''; | |
db.portals.save(x); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment