title: How to update a specific object in a array of objects in Node.js and Mongoose
body: <p>I am new to node.js coming from java experience. I have a situation that I am trying to wrap my head around. My stack is express.js, mongoose, ejs template. Here is my scenario:
  I have a schema:</p>
  
  <pre><code>var UserSchema = mongoose.Schema({
  name: {
      type: String,
      index: true
  },
  password: {
      type: String,
      select: false
  },
  email: {
      type: String
  },
  academic: [{
      qualification: String,
      institute: String,
      from: String,
      to: String,
      about: String
  }]
  </code></pre>
  
  <p>});</p>
  
  <p>there is a list of academics. I want to update only one academic object in that list. How would I go about this? </p>
  
  <pre><code>router.post('/academic/schools/update', function (req, res) {
  </code></pre>
  
  <p>});</p>
  
  <p>I pass the values from ejs template into the route and getting the values in the req.body. How would I in node and mongoose query that specific object in the route and then updates its values. I have thought about maybe adding an Id to the academic object to be able to keep track of which to update.</p>