title: How to process data read from database
body: <p>I am processing data read from database on the server using the following code:</p>
  
  <pre><code>module.exports = mongoose.model('Todo', {
      text : {type : String, default: ''},
      created_at : Date
  });
  
  var processTodos = function ( todos ){
  
    for (var i = todos.length - 1; i &gt;= 0; i--) {
      // Following update is not happening
      todos[i].created_at = "Custom date";
    };
  
    console.dir(todos);
  
    return todos;
  
  };
  </code></pre>
  
  <p>I am not able to figure out how to update this. Is there a syntax issue that is causing this.</p>
  
  <p>I am using MEAN stack for my application.</p>
  
  <pre><code>// Following update is not happening
  todos[i].created_at = "Custom date";
  </code></pre>
  
  <p>What am i missing here.</p>
  
  <p>Here is the console log for "console.dir(todos);":</p>
  
  <pre><code>{ _id: 5489dda3f23f159400475dba,
    created_at: Thu Dec 11 2014 23:38:35 GMT+0530 (India Standard Time),
    __v: 0,
    text: 'Testing sorting at server side' }
  { _id: 5489ddacf23f159400475dbb,
    created_at: Thu Dec 11 2014 23:38:44 GMT+0530 (India Standard Time),
    __v: 0,
    text: 'It works' }
  { _id: 5489f31a12fa54cc127f3e1d,
    created_at: Fri Dec 12 2014 01:10:10 GMT+0530 (India Standard Time),
    __v: 0,
    text: 'time to add more data' }
  </code></pre>