I have an existing MongoDB collection containing user names. The user names contain both lower case and upper case letters.
I want to update all the user names so th
With the accepted solution I know its very trivial to do the same for an array of elements, just in case
db.myCollection.find().forEach( function(e) { for(var i = 0; i < e.articles.length; i++) { e.articles[i] = e.articles[i].toLowerCase(); } db.myCollection.save(e); } )