title: Set property in mongoose object after query
body: <p>while development of an API, I often need to set extra properties in the result of mongoDb query results. But I can't do it in a good way. For example</p>
  
  <p>Model</p>
  
  <pre><code>const Cat = mongoose.model('Cat', { name: String,age:Number });
  </code></pre>
  
  <p>Query</p>
  
  <pre><code>Cat.findOne({age:2})  .then(
      cat=&gt;{
          cat.breed="puppy";    
          console.log(cat)
      } )
  </code></pre>
  
  <p>here after I get the result from <strong>mongoDb</strong> I want to set the property of <strong>breed</strong> to the result , but I can't do it because the property is not defined in the <strong>Schema</strong></p>
  
  <p>So to set an extra property I use a hack </p>
  
  <pre><code>cat = JSON.parse(JSON.stringify(cat));
  cat.favFood = "Milk"
  </code></pre>
  
  <p>I don't think its a good way to code. please give a better way of setting property and explain how the hack is working.</p>