title: Information isn't being passed to an array via Mongoose, can't work out why
body: <p>Apologies if this has been answered before, I have checked other answers and can't work it out from those.</p>
  
  <p>I have a set of information that I would like placed into an array named "teamDetails". Here is the relevant /post item from server.js:</p>
  
  <pre><code>app.post('/create', (req, res) =&gt; {
      console.log('Post command received');
      console.log(req.body);
      console.log(req.body.data.teamDetails[0]);
      //We need to push the variable below, 'teamDetails', as an object into an array of the same name
      var teamDetailsObj = {
      // Modified for Postman
      "teamName": req.body.data.teamDetails[0].teamName,
      "teamNameShort": req.body.data.teamDetails[0].teamNameShort,
      "teamfounded": req.body.data.teamDetails[0].teamFounded,
      "teamHome": req.body.data.teamDetails[0].teamHome
      };
      console.log(teamDetails);
      var newTeam = new Team({
          "data.added": new Date(),
          "data.entry": req.body.data.entry
      });
  
      newTeam.save().then((doc) =&gt; {
          console.log("This is newTeam.data: " + newTeam.data);
          console.log("This is teamDetailsObj: " + teamDetailsObj);
          newTeam.data.teamDetails.push(teamDetailsObj);
          var teamId = doc.id;
          res.render('success.hbs', {teamId});
          console.log("Team Added - " + teamId);
      }, (e) =&gt; {
          res.status(400).send(e);
      });
  });
  </code></pre>
  
  <p>Here is my team.js model:</p>
  
  <pre><code>var mongoose = require('mongoose');
  var ObjectID = mongoose.Schema.Types.ObjectId;
  var Mixed = mongoose.Schema.Types.Mixed;
  var Schema = mongoose.Schema;
  
  var Team = mongoose.model('Team', {
    data: {
      entry: {
        type: String,
        default: "USER.INPUT"
      },
      added: {
        type: Date,
        default: Date.Now
      },
      teamDetails: [
        {
          teamName: {
            type: String,
            trim: true,
            required: true,
            default: "First Team"
          },
          teamNameShort: {
            type: String,
            trim: true,
            uppercase: true,
            maxlength: 3,
            required: true
          },
          teamFounded: {
            type: Number,
            maxlength: 4
          },
          teamHomeCity: {
            type: String
          }
        }
      ]
    }
  });
  
  module.exports = {Team};
  </code></pre>
  
  <p>Lastly, the sample data I'm trying to inject via Postman:</p>
  
  <pre><code>{
      "data": {
          "entry": "Postman.Entry",
          "teamDetails": [
              {
                  "teamName": "Test Teamname",
                  "teamNameShort": "TTN",
                  "teamFounded": "1986",
                  "teamHome": "London",
                  "players": [
                      {
                      "player1Name": "Test Player 1",
                      "player1Position": "Forward",
                      "player1Nationality": "GBR"
                      },
                      {
                      "player2Name": "Test Player 2",
                      "player2Position": "Defender",
                      "player2Nationality": "UKR"
                      },
                      {
                      "player3Name": "Test Player 3",
                      "player3Position": "Goaltender",
                      "player3Nationality": "IRL",
                      "captain": true
                      }
                  ],
                  "coachingStaff": {
                      "headCoach": "Derp McHerpson",
                      "teamManager": "Plarp McFlarplarp"
                      }
                  }
              ]
          }
  }
  </code></pre>
  
  <p>(Disregard the players section, it's another kettle of fish)</p>
  
  <p>As a result of using my code above, the resulting entry for teamDetails is just an empty array. I just can't get my code to push the teamDetailsObj into it.</p>
  
  <p>Any help anyone can provide is appreciated.</p>