title: Make a new object from a multiple record parse.com object
body: <p>I need to make a new object out of a multiple record parse.com object in javascript.</p>
  
  <p>This is how I get the entire fetched object:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function(articleID, callback) {
    "use strict";
    var Comment = Parse.Object.extend('Comment');
    var query = new Parse.Query(Comment);
    query.descending('createdAt');
    query.equalTo('commentFor', {__type:"Pointer", className:"Article", objectId:articleID});
    query.equalTo('commentApproved', true);
    query.find().then(function(results) {
  
      callback(results);
  
    }, function(error){
      callback({error: error});
    });
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now, the problem is, that this returns (<code>callback()</code>) an object which contains some sensitive data, such as the emails of all commenters, so I want to return a new object with, say, just 'name', 'date', and 'comment'. I just don't know how to build an object like this with a multiple record object as the master.</p>
  
  <p>I am making this in node.js, if that helps in any way.</p>
  
  <p>I'd like something along the line of</p>
  
  <pre><code>[
      {
          "name": "Robert",
          "date": "2016-01-18T17:59:27.378Z",
          "comment": "Hello World!"
      },
      {
          "name": "Bob",
          "date": "2016-01-15T16:37:35.226Z",
          "comment": "Bees knees"
      }
  ]
  </code></pre>
  
  <p>I've tried this, but it doesn't seem to work - I don't get the output I'd expect:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var test = function(articleID, callback) {
    "use strict";
    var Comment = Parse.Object.extend('Comment');
    var query = new Parse.Query(Comment);
    query.descending('createdAt');
    query.equalTo('commentFor', {__type:"Pointer", className:"Article", objectId:articleID});
    query.equalTo('commentApproved', true);
    query.find().then(function(results) {
  
      var object = {};
  
      for(var i = 0; i &lt; results.length; i++) {
        object += {
          commentName: results[i].get('commentName'),
          commentWebsite: results[i].get('commentWebsite'),
          commentContent: results[i].get('commentContent'),
          createdAt: results[i].get('createdAt')
        };
      }
  
      callback(object);
  
    }, function(error){
      callback({error: error});
    });
  };</code></pre>
  </div>
  </div>
  </p>