I have 3 classes "campaigns", "relationships" and "locations" on parse.com I have a query to hit the campaigns table and get its information by
var query = new Parse.Query("Campaigns");
query.find({
success: function(results) {
},
error: function(){
response.error("failed to get a respose");
}
});
Now I want to hit the locations table by navigating through the relationships table. (the relationships table has a column which stores the object IDs of the campaigns in the campaigns class). How do I access the corresponding data from the "locations" table? I know I have to make another query but I cant find the correct syntax.
for android (java) the syntax would be something like-
ParseQuery<ParseObject> query = new ParseQuery<ParseObject>("Campaigns");
ParseQuery<ParseObject> query2 = new ParseQuery<ParseObject>("Relationships");
ob2 = query.find();
for (ParseObject object : ob2) {
ParseObject Locations = new ParseObject("Campaigns");
query2.whereEqualTo("campaignIDString", object.getObjectId());
query2.include("locationID"); //the pointer column it must have
try {
ob = query2.find(); //this holds the locations Table data
}
}
Sorry about the formatting, not very used to SO formatting yet