title: Parse Javascript - How to query by relationship object's attribute
body: <p>I am wondering if there is a way to directly query objects by relationship object's attribute?</p>
  
  <p>It might sound confusing, for example:</p>
  
  <p>Each user have many installations, I have pointer from each installation to its user, forming a many to one relationship.</p>
  
  <p>I would like to find all installation that belongs to one user with given username.</p>
  
  <p>Similar use case: find all installations that belong to user whose last name is 'James'. But there are many users instead of one in this case.</p>
  
  <p>My current solution is, query.find the user with given criteria, and then for each user do an installation query with query.equalTo("user", fetchedUser). This just feels very cumbersome and expensive.</p>
  
  <p>Another solution is to "flattening" objects and put as many attributes on the querying target object as possible. So we can just use a query.find for one time. For our examples: put copies of username and last name on installation. But then the data is less relational if we end up just not using a user object; if we choose to keep user object, there is complicated synchronization down to installations (child objects) and vice versa that needs to be done when we update user (mother object).</p>
  
  <p>Is there a better, cleaner way to do this?</p>
  
  <p>Thanks!</p>