title: Updating a Subdocument array INSIDE another Subdocument array Mongoose
body: <p>I am at my wits end with something that is seemingly straightforward:<br>
  I need to be able to push new gifts into the Events Array under the specific user. Because each event will have numerous gifts added, I want to keep them all under the user, as they are the one creating the event, and the gifts will live inside of their event where they belong.<br>
  The PROBLEM is: when I use the mongoose method 'findByIdAndUpdate', I can only find the main user, and from there, push an event to the events array. What I NEED to be able to do: push gifts to a specific event under that user. I am using mongoose Subdocuments. See my schema below and how I have a subdocument schema (EventSchema) inside of the main user schema, and a subdocument (gift) schema inside the event schema.<br></p>
  <p>SCHEMA:<br></p>
  <pre><code>const Schema = mongoose.Schema;
  
  let giftArr = new Schema({
      giftname: String,
      giftlink: String,
      claimed: Boolean,
      claimee: String
  })
  
  let eventSchema = new Schema({
      eventname: String,
      eventowner: String,
      date: { 
          type: Date, 
          default: Date.now 
      },
      attendees: [
          {
              attendeename: String
          }
      ],
      gift: [giftArr]
  })
  
  let userSchema = new Schema({
      username: String,
      email: { type: String, required: false },
      events: [eventSchema]
  });
  </code></pre>
  <p>Here are my controllers for my POST &amp; GET routes: <br></p>
  <pre><code>export const insertEventsById = ((req, res) =&gt; {
      const update = { $push: { events: req.body } }
      const id = req.params.userID
      Gift.findByIdAndUpdate(id, update, (err, data) =&gt; {
          if (err) {
              console.log(err);
          } else {
              res.json(data)
              console.log(data);
          }
      })
  })
  
  export const getUserById = (req, res) =&gt; {
      Gift.findById(req.params.userID, (err, user) =&gt; {
          if(err){
              res.send(err)
          }
          res.json(user)
          
      })
  }
  </code></pre>
  <p>To further illustrate, here is my postman GET request for a USER. I can push to the 'events'  array (red arrow) as my findByIdAndUpdate method shows above, but when I attempt to go one nested level deeper, into the gift array (green arrow), I cannot find any documentation on that.<br>
  <a href="https://i.stack.imgur.com/9ileR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9ileR.png" alt="Postman GET" /></a></p>
  <p>I been up and down the mongoose subdocuments and queries pages, and I cannot find a method that will pull specifically the '_id' of the particular event I need. I have even tried the methods on the embedded schemas to specifically look for _id's that way.<br>
  Can someone point out where I am going wrong here? Thanks in advance...as always fellow Stacks.</p>