Update subdocument in array and insert new subdocument if not present in array

I have a Schema as follows (simplied for this)

const userSchema = new Schema({
    _id: { type: String, required: true }
    data: [{
        _id: { type: String, required: true }
        score: { type: Number, default: 0 }
    }]
});

I am struggling to know how to implement a query that checks if

  1. A document with _id == id exists
  2. A subdocument in the data array with _id == dataId

And if these conditions are true, increment the score by 1

If the document isn’t present, create a new document with data.score: 1, but if the subdocument isn’t present, I want to be able to add a new subdocument into the array and set the score to 1 so data.score: 1 also.

Thank you for any help.