Mongo Playground

Configuration

[{"_id":"1","arrayX":[{"id2":"123","arrayY":[{"colour":"blue","size":"small"},{"colour":"red","size":"small"},]},{"id2":"12345","arrayY":[{"colour":"blue","size":"small"},{"colour":"purple","size":"small"}]}]}]

Query

db.collection.update({"arrayX.arrayY.colour":"blue"},{$set:{"arrayX.$[].arrayY.$[c].colour":"white"}},{arrayFilters:[{"c.colour":"blue"}]})

Result