Realm Validation

Hi All

Is there a way to find all documents in A collection with a field of typeA and update/change this so that field is of typeB

something like

db.collection.updateMany({field: {$exists: true}, field: {isOfTypeA} }, {$set: {field : typeB } } )

Thanks in advance