I have a setup with Three relevant classes: _User, Article, and Profile. In Article I have a pointer named author for _User, and in Profile, I have the same; a pointer, but named user, for _User.
Now, I want to retrieve data from Article, with the cols firstname and lastname in Profile, where the pointer in Article matches the objectId in _User, and the pointer in Profile.
Basically what I would solve with an inner join in SQL.
How do I go about this with just one parse call?
This is what I have so far:
var Article = Parse.Object.extend("Article");
var query = new Parse.Query(Article);
query.include("category");
query.find({
success: function(results) {
console.log("Successfully retrieved " + results.length + " article(s):");
// Do something with the returned Parse.Object values
for (var i = 0; i < results.length; i++) {
var object = results[i];
console.log(object.get('title'));
console.log(object.get('content'));
console.log(object.get('category').get("categoryName"));
}
},
error: function(error) {
console.log("Error: " + error.code + " " + error.message);
}
});