So I'm making a query to a table that I have for followers. Each result in the array has a userA and a userB object in it. When I try to access the userB object, it's null. However, when I access the elements of the array, userB shows...
Parse.Cloud.define("getFeed", function(request, response) {
Parse.Cloud.useMasterKey();
/***********************************
**** GETTING FRIENDS LIST
***********************************/
var query = new Parse.Query("Follow");
var user = {"__type":"Pointer","className":"_User", 'objectId':request.params.user};
query.equalTo("userA",user);
query.include("userB");
query.find({
success: function(follows) {
/***********************************
**** GETTING FRIENDS' UPDATES
***********************************/
//var feedUser = [];
console.log("FOLLOWS: "+follows);
console.log("FIRST FOLLOW *******"+follows[0]);
console.log("USER B VALUE ********"+follows[0].userB);
response.success(follows);
// for(var i in follows) {
// feedUser.push(i.userB);
// }
// var queryUpdate = new Parse.Query("Goal");
// queryUpdate.containedIn("user",feedUser);
// queryUpdate.find({
// success: function(results) {
// response.success(friends);
// },
// error: function(error) {
// response.error(error);
// }
// })
},
error: function(error) {
response.error(error);
}
});
});