Modify field type

How to change the field data type of an existing document from string to an integer?

Hi @Daipayan_Mandal,

You can change the data type of a field by using the data type selectors on the right of the field in the Atlas Cloud Cluster as well as MongoDB Compass.

viE1h

For more info on data-type read here

If you want to update it using Mongo shell or any specific drivers of MongoDB then you can refer to the $convert operator.

Hope it helps !!

All the Best
Kushagra

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.