title: Mongoose: update an element of an array of a specific document
body: <p>I am having a collection of documents called 'company'.</p>
  
  <p>company 1 -</p>
  
  <pre><code>{ 
    _id: '1',
    data:[
      {_id:'11', value: 'emp11'},
      {_id:'12', value: 'emp12'}
    ]
  }
  </code></pre>
  
  <p>company 2-</p>
  
  <pre><code> { 
    _id: '2',
    data:[
      {_id:'21', value: 'emp21'},
      {_id:'22', value: 'emp22'}
    ]
  }
  </code></pre>
  
  <p>Now I want to update value 'emp11' to 'emp99'.
  I'm following this approach-</p>
  
  <pre><code>companyModel.findById('1', function(err, company) {
      return company.data.update(
          {_id: '11'},
          {$set: {value: 'emp99'}}
      );
  });
  </code></pre>
  
  <p>I'm able to get the company but after that it's showing an error-</p>
  
  <pre><code>company.data.update is not a function
  </code></pre>
  
  <p>Please suggest a possible solution.</p>