Mongo Playground

Configuration

[{"_id":1,"points":1,"monthly":[]},{"_id":2,"points":1,"monthly":[{"year":1,"month":1,"points":1}]}]

Query

db.collection.update({"_id":1,"monthly.year":2021,"monthly.month":7},{"$inc":{"points":5,"monthly.$.points":5}},{upsert:true})

Result