title: Push element into nested array mongoose nodejs
body: <p>I am trying to push a new element into an array, I use mongoose on my express/nodejs based api. Here is the code for mongoose:</p>
  
  <pre><code>Serie.updateOne({'seasons.episodes.videos._id': data._id}, {$push: {'seasons.episodes.videos.$.reports': data.details}},
      function(err) {
        if (err) {
          res.status(500).send()
          console.log(err)
        }
        else res.status(200).send()
      })
  </code></pre>
  
  <p>as for my series models, it looks like this:</p>
  
  <pre><code>const serieSchema = new mongoose.Schema({
    name: {type: String, unique:true, index: true, text: true},
    customID: {type: Number, required: true, unique: true, index: true},
    featured: {type: Boolean, default: false, index: true},
    seasons: [{
      number: Number,
      episodes: [{number: Number, videos: [
        {
          _id: ObjectId,
          provider: String,
          reports: [{
            title: {type: String, required: true},
            description: String
          }],
          quality: {type: String, index: true, lowercase: true},
          language: {type: String, index: true, lowercase: true},
        }
        ]}]
    }],
  });
  </code></pre>
  
  <p>When I execute my code, I get MongoDB error code 16837, which says "cannot use the part (seasons of seasons.episodes.videos.0.reports) to traverse the element (my element here on json)"</p>
  
  <p>I've tried many other queries to solve this problem but none worked, I hope someone could figure this out.</p>