Mongodb update Level 3 and above cannot be deleted

  mongodb, question
Project.updateOne(r, {
 $pull: {
 thunder2: {
 files: {
 _id: "5ab362d446f15936bcea7dd3"
 }
 }
 }
 }, function(err, data) {
 if (err) {
 res.send("")
 } else {
 res.send("1")
 }
 })

Yes, but MongoDB 3.6 support is required. have a lookarrayFilters. For example:

//Data sample:
 {
 "_id": ObjectId("5ab8c93249e47f821364662b"),
 "array": [{
 "array": [{
 "_id": ObjectId("5ab8c93249e47f821364662a")
 }]
 }]
 }
 //Update statement:
 db.test.update({
 "array.array._id": ObjectId("5ab8c93249e47f821364662a")
 }, {
 $pull: {
 "array.$[elm].array": {
 _id: ObjectId("5ab8c93249e47f821364662a")
 }
 }
 }, {
 arrayFilters: [{
 "elm.array._id": ObjectId("5ab8c93249e47f821364662a")
 }]
 })