title: My $push method in Mongoose does not work ok
body: <p>I have a problem understanding why $push creates only one element in nested array and shows only the id of that element</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>const mongoose = require('mongoose');
  
  let historySchema = new mongoose.Schema({
      time: {
          type:String
      }
  })
  
  //users schema
  
  let userSchema = new mongoose.Schema({
      name:{
          type:String,
          
      },
      dob:{
          type:String,
          
      },
      email:{
          type:String,
          
      },
      noOfpeopleClimbing:{
          type: Number,
          default:0
      },
      details:{
          type:String,
          
      },
      status:{
          type: Boolean,
          default: false
      },
      timeIn:{
          type: Number,
          default: 0
      },
      timeOut:{
        type: Number,
        default: 0
      },
      timeFinal:{
        type: Number,
        default: 0
    },
      timeHistory:[{historySchema}]
  
  })
  
  let User = module.exports = mongoose.model("User", userSchema);</code></pre>
  </div>
  </div>
  </p>
  <p>I am talking about timeHistory:[{historySchema}] the rest you can ignore.
  I am running the next test:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>app.post('/users/reset_timeIn/:id', function(req,res){
  
      Users.findOneAndUpdate({_id:req.params.id},{
          timeIn:0,
          timeOut:0,
          timeFinal:0,
          timeHistory:{
              $push: {time:"some text" }
          },
          status:false,
          noOfpeopleClimbing:0
  
  
  
      },function(err){
          if(err){
              console.log(err);
              return
          }else{
              res.redirect(req.get('referer'));
          }
      })
  });</code></pre>
  </div>
  </div>
  </p>
  <p>time:&quot;some text&quot;is just for testing. The output of this test, no matter how many times I have pushed an elment is like this:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{
              "noOfpeopleClimbing": 0,
              "status": false,
              "timeIn": 0,
              "timeOut": 0,
              "timeFinal": 0,
              "_id": "5fa3faa68b302530fcb6bba5",
              "name": "Name",
              "dob": "1666-02-02",
              "email": "name@name.com",
              "__v": 0,
              "details": "name",
              "timeHistory": [
                  {
                      "_id": "5fa44343aece7d37dc532fd9"
                  }
              ]
          },</code></pre>
  </div>
  </div>
  </p>
  <p>The &quot;timeHistory&quot; should containt the id and the field time:&quot;some text&quot;, right? And if i push another record to have that one as in the second object of that array? right? Please help</p>