I want to convert an int array to strings. My int:
"key" : 280
If I have only 1 integer to change i can use:
db.collection.find( { 'key' : { $type : 16 } } ).forEach( function (x) { x.key = ""+x.key; db.collection.save(x);});
$type 16 describes an 32-bit integer. With that code all looks fine.
But if I have an array like:
"key" : 280, 193, 213
and I use this code I get:
"key" : "280,193,213"
but I want -> "key" : "280","193","213"
Have anybody an solution ?