I am trying to change the type of a field from within the mongo shell.
I am doing this...
db.meta.update(
{\'fields.properties.default\': { $type :
You can easily convert the string data type to numerical data type.
Don't forget to change collectionName & FieldName.
for ex : CollectionNmae : Users & FieldName : Contactno.
Try this query..
db.collectionName.find().forEach( function (x) {
x.FieldName = parseInt(x.FieldName);
db.collectionName.save(x);
});