I am trying to convert a field datatype from null to decimal.
I tried to covert in the following way:
db.Battery.update(
{MAX_AH_DAILY_THROUGHPUT:{$type:10}},
[{$set:{MAX_AH_DAILY_THROUGHPUT:{$toDecimal:"$MAX_AH_DAILY_THROUGHPUT"}}}],
{multi:true}
);
In MAX_AH_DAILY_THROUGHPUT field all values are null, but as per requirement I need to convert the field type as decimal.
Can someone help me how to convert it into decimal.
Thanks in advance.