title: Parse.com: Find all objects belonging to a user with objectId
body: <p>I have a Class in parse, say Pictures. Each of these belongs to a user. Reference to this user is stored in the Pictures table/class as a <code>Pointer</code> to the user.</p>
  
  <p>In my cloud code I am trying to get all Pictures belonging to a user, using master key. Following is my code:</p>
  
  <pre><code>Parse.Cloud.define("getPictures", function(request, response) {
  
    Parse.Cloud.useMasterKey();
  
    var query = new Parse.Query("Pictures");
  
    query.equalTo("user", request.params.user);
  
    query.find({
      success: function(results) {
  
        var status = "Found " + results.length + " pictures for userId " + request.params.user;
        response.success(status);
  
      },
  
      error: function() {
  
        status = "No pictures exist for userId " + request.params.user; 
        response.error(status);
      }
    });
  });
  </code></pre>
  
  <p>This code outputs that there are 0 pictures for a certain user with id 'xyz' for example. However, I can see that the user has a lot of pictures stored.</p>
  
  <p>I have also verified that the problem is not with using master key, as I see in the console log that the code is being executed as master. Moreover, if I query for a picture by <code>objectId</code>, it does come out in the results, which means ACL is not the problem here.</p>
  
  <p>I think I have to use relations/joining here, but I am not sure how to do that.</p>