Saturday, 15 January 2011

database - Update MongoDB collection with $toLower or $toUpper -



database - Update MongoDB collection with $toLower or $toUpper -

i convert 'state' field 'organization' upper case.

'ky' becomes 'ky' 'tx' becomes 'tx' 'ca' becomes 'ca'

why doesn't work

db.organizations.update(state:{ $exists : true }},{$set:{state:{ $toupper : state }}}, false, true)

you have set touppercase() this:

"$set": { "state": doc.state.touppercase() } }

database mongodb

No comments:

Post a Comment