Mongo Playground

Configuration

[{"key":1,"supplierName":"Test supplier","phone":12345678,"deliveries":[{"deliveryId":1,"amountDelivered":123,"price":123},{"deliverId":2,"amountDelivered":123,"price":1234}]}]

Query

db.collection.update({"key":1},[{"$set":{"deliveries":{"$concatArrays":["$deliveries",[{"deliveryId":{"$sum":[1,{"$size":"$deliveries"}]},"amountDelivered":123,"price":123}]]}}}])

Result