title: Mongoose TypeError: User is not a constructor
body: <p>I'm trying to add a subdocument to a parent schema with Mongoose and MongoDB however I'm being thrown the following error:</p>
  
  <pre><code>TypeError: User is not a constructor
  </code></pre>
  
  <p>This is based off Mongoose's documentation on <a href="http://mongoosejs.com/docs/subdocs.html" rel="noreferrer">subdocuments</a> and I think everything is the same. How can I debug this further?</p>
  
  <p>Router</p>
  
  <pre><code>// Add a destination to the DB
  router.post('/add', function(req, res, next) {
    let airport = req.body.destination
    let month = req.body.month
    let id = (req.user.id)
  
    User.findById(id , function (err, User) {
      if (err) return handleError(err)
  
      function addToCart (airport, month, id) {
        var user = new User ({
          destinations: [(
            airport = '',
            month = ''
          )]
        })
  
        dog.destinations[0].airport = airport
        dog.destinations[0].month = month
        dog.save(callback)
        res.status(200).send('added')
      }
      addToCart()
    })
    console.log(airport)
  })
  </code></pre>
  
  <p>Schema</p>
  
  <pre><code>var destinationSchema = new Schema({
    airport: String,
    month: String
  })
  
  // Define the scheme
  var User = new Schema ({
    firstName: {
      type: String,
      index: true
    },
    lastName: {
      type: String,
      index: true
    },
    email: {
      type: String,
      index: true
    },
    homeAirport: {
      type: String,
      index: true
    },
    destinations: [destinationSchema]
  })
  
  
  User.plugin(passportLocalMongoose)
  
  module.exports = mongoose.model('User', User)
  </code></pre>