Reputation: 157
I searched a lot before asking, but i got very confused since parse logging and its tutorials seems not to be helpful.
I am trying to query a Class which has a Pointer, which Pointer has another Pointer, which in its turn has a string column that i want to query. My code is:
Parse.Cloud.afterSave('Lists', function(request, response){
var list = request.object;
var date = list.get("dateTime").exactTime; // Here i successfully get a string
// I've tried to use fetch() to fetch the first Pointer and then get the inner Pointer.
list.get('delDetails').fetch().then(function(dd){ //delDetails is the 1st Pointer
var tname = dd.get('tName'); // tName is the inner Pointer, that has the string i want to receive
})
});
How should i continue? Is that the right logic or i have to think differently about it?
Upvotes: 1
Views: 229
Reputation: 970
Class A, has a pointer(B) named b, Class B has a pointer(C) named c. You want to query A and then include both b and c information?
try this way
var query = new Parse.Query('A');
query.include('b.c');
query.find().then(function(list){
for(var i=0; i<list.length; i++){
var b = list[i].get('b');
var c = b.get('c');
console.log(c.get('xxx');
}
});
Upvotes: 1