title: Parse.com / Backbone.js how do I retrieve / list other users' public display names using JavaScript
body: <p>I am trying to use Parse.com and Backbone.js to list users names with comments they have made and make them visible to other users. E.g:</p>
  
  <p>Post 1:
  Display name: "Joe Bloggs"
  Comment: "lorem ipsum 1..."</p>
  
  <p>Post 2:
  Display name: "Jim Doodah"
  Comment: "lorem ipsum 2..."</p>
  
  <p>As it is prudent to set the ACL access to only allow a user to see their own details, I am having trouble listing user public display names for other users. </p>
  
  <p>I suspect this is quite a common issue?</p>
  
  <p>Basically how do I show "Joe Bloggs" to all users??</p>
  
  <p>I have tried setting up a new "UserPublic" class with "displayName" set as the user's publicly accessible name. </p>
  
  <p>However, I am having trouble "joining" (I come from SQL world) the display name in the UserPublic class with the comments class using the  user's Parse.User.current().id.</p>
  
  <p>What I think I should do is this in the Parse database? But I think this is where the whole plan is flawed as there is no direct join between the Comments class and the UserPublic class via the user id to get the displayName?</p>
  
  <p>User class:</p>
  
  <pre><code>ObjectId: G6GYjqCwdh    
  email: jbloggs@gmail.com    
  password: blah  
  ACL: G6GYjqCwdh read/write
  </code></pre>
  
  <p>UserPublic class:</p>
  
  <pre><code>ObjectId: m5xN9CRbpM    
  userId: Pointer&lt;_User&gt;: G6GYjqCwdh  
  displayName: Joe Bloggs 
  ACL: Public Read
  </code></pre>
  
  <p>Comments class:</p>
  
  <pre><code>ObjectId: 5S8mTSi4Eh    
  userId: Pointer&lt;_User&gt;: G6GYjqCwdh NOT SURE WHAT POINTER TO SET HERE TO GET THE DISPLAYNAME?? 
  comments: "lorem ipsum 1..."    ACL: Public Read
  </code></pre>
  
  <p>In backbone I would like to grab the public display names like this:</p>
  
  <pre><code>var CommentsModel = Parse.Object.extend({
      className: "Comments"
  }); 
  var Collection = Parse.Collection.extend({
      model: "CommentsModel"
  });
  var collection = new Collection();
  collection.query = new Parse.Query(CommentsModel);
  collection.query.include("userId"); //NOT SURE WHAT POINTER TO CALL HERE TO GET THE DISPLAYNAME ??
  collection.fetch(
                      {
                          success: function (collection) {
                              collection.each(function (model, index) {   
                                      //NOT SURE WHAT POINTER TO CALL HERE TO GET THE DISPLAYNAME ??
                                      var displayName = model.get("userId??").get("displayName");
                                      model.set("displayName", displayName);
                                  }
                          }
                      }
                  );
  </code></pre>
  
  <p>I am hoping you guys can help as usual?? </p>
  
  <p>Any help very much appreciated!</p>