1

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?

2
  • 1
    You can put them together... You do the first query and when it is success you do the second query and do as much more queries as you want, also keep in mind that afterSave trigger can run only less than 3 seconds Commented May 15, 2016 at 17:36
  • You are absolutely correct! Thank you Mazel, i highly appreciate your help. Commented May 15, 2016 at 18:25

1 Answer 1

1

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');
    }
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.