Database
[]
Query
db.collection.update({/** the criteria you want to match outside array*/"software_house":"k1","client_id":"1234"},[{"$addFields":{"transactions":{"$filter":{"input":"$transactions","as":"t","cond":{$not:{$and:[/** the criteria you want to match in array*/{$eq:["$$t.antecedents",12345]},{$eq:["$$t.consequents","015896018"]}]}}}}}},{"$addFields":{"transactions":{"$setUnion":["$transactions",[{"antecedents":12345,"consequents":"the entry you want to upsert","antecedent support":-1}]]}}}],{multi:true,upsert:true})