Why doesn't MongoDb store my slashes in this string?
- by Rob Dudley
Can anyone tell me why this command doesn't work from the MongoDB shell client:
db.coll.update({'live':true},{$set:{'mask':"\D\D\D\D\D\D\D\D"}},false,true)
but
db.coll.findOne({'id':'someId'})
returns the mask field as:
"mask" : "DDDDDDDD",
Where are the slashes going?
I've tried "double escaping" with \\D and that inserts both slashes:
"mask" : "\\D\\D\\D\\D\\D\\D\\D\\D",
MongoDB shell version: 2.0.6, MongoDB version: 2.0.5, OSX Lion
Thanks