lawonga
lawonga

Reputation: 832

Parse pointer query in a pointer query

I have a somewhat complex query operation I need to figure out. I have 2 'classes': iv and iv_users.

Within the iv class is a pointer that points to an entry in iv_users. Within iv_users is a string called iv_name.

WIth the function I have written below, it retrieves the basic data of the iv class... listing all the pointers and pointer id's. How do I also retrieve the pointer data in the above (iv_name (string) in iv_users)?

Parse.Cloud.define('iv_search', function(request, response){
var userId;
var reqSeach = request.params.iv_hook;
var iv = Parse.Object.extend("iv");

var iv_search = new Parse.Query(iv);
iv_search.equalTo("iv_hook", {
    __type: "Pointer",
    className: "JList",
    objectId: reqSeach
  });
iv_search.find({
    success:function(results){
        response.success(results);
    }, error: function(){
        response.error("Search failed");
    }
  });
});

Upvotes: 0

Views: 79

Answers (1)

Jeremy Jackson
Jeremy Jackson

Reputation: 2257

In order to get the data related to that pointer, you have to include it in the query, like this:

iv_search.include('iv_hook');

Or whatever your field name is.

Upvotes: 1

Related Questions