I'm trying to query data from my Parse.com database through the JavaScript SDK but the data from a pointer is not coming through.
There are three relevant Classes in my Parse DB: Questions, Talks and _User. The Questions class have pointers columns ('questioning' and 'talk') which point to the questioning user and the talk the question was submitted to.
The code looks like this:
<script type="text/javascript">
Parse.initialize("PARSE APP ID", "PARSE JS KEY");
var Questions = Parse.Object.extend("Questions");
function getPosts(){
var query = new Parse.Query(Questions);
query.equalTo("active", true);
query.descending("CreatedAt");
query.find({
success: function (results){
var output = "";
for (var i in results){
var talk = results[i].get("talk");
var question = results[i].get("question");
var questioning = results[i].get("questioning");
var talk = results[i].get("talk");
output += "<li>";
output += "<h3>"+question+"</h3>";
output += "<p>"+questioning+"</p>";
output += "<p>"+talk+"</p>";
output += "</li>";
}
$("#list-posts").html(output);
}, error: function (error){
console.log("Query Error:"+error.message);
}
});
}
getPosts();
And the output looks like this:
Test Question 1
[object Object]
[object Object]
The question itself is correct (Test Question 1) but instead of the user (or user id) it's showing [object Object]. Same thing for the Talk. Any idea how to retrieve and show this information?
Thanks!
console.log('question', question);