The number field in my collection can be either Double or Int, and for now it's always equals 1 or 1.0. So I could use this:
db.getCollection('my_collection').update(
{number:{$type:"double"}},
{$set: {number: new NumberInt(1)}},
{multi:true}
)
But what if I have various values, not only 1.0? How do I update each field in collection if it's Double type?
Thank you in advance.