Database

[{"id":1,"name":"xyz","companyName":"abc","environment":[{"clusterid":2,"clusterName":"qwe"},{"clusterid":6,"clusterName":"nme"}]}]

Query

db.collection.update({id:1/**customer id*/},{"$set":{"environment.$[element]":{"clusterId":4,/**environment object with updated clusterId*/"clusterName":"asd"/**environment object with updated clusterName*/}}},{arrayFilters:[{"element.clusterid":6/**clusterId of environment you have to update*/}]})

Result