I was using an old parse SDK version 1.5.0 and my function was returning with all the includes. Now I tried to use the latest SDK and the function is returning the main object only (on the gate and location I get "pointers" only.).
Here is the code:
Parse.Cloud.define("get_gates_for_user", function(request, response) {
var userId = request.params.userId;
var gateToUserQuery = new Parse.Query("GateUserJoinTable");
gateToUserQuery.equalTo("user", {
__type: "Pointer",
className: "_User",
objectId: userId
});
gateToUserQuery.include("gate");
gateToUserQuery.include("location");
gateToUserQuery.find({
success: function(results) {
response.success(results);
},
error: function(error) {
console.log(error.message);
response.error(ERROR_CODE_GENERAL_ERROR);
}
});
});