Skip to content

Instantly share code, notes, and snippets.

@wytten
Created April 21, 2014 19:53
Show Gist options
  • Select an option

  • Save wytten/11154363 to your computer and use it in GitHub Desktop.

Select an option

Save wytten/11154363 to your computer and use it in GitHub Desktop.
MongoDB: Convert 'database' attribute of all documents in collection to lower case
db.GroovyScriptResult.find({database: {$ne:null}}).forEach(
function (e) {
db.GroovyScriptResult.update({_id: e._id}, {$set: {database: e.database.toLowerCase() } })
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment