Start a new topic

Nested relations

Hello! I am using Angular. I have some nested relations between collections. My collections look like this:

collection1{

name:{"_type":"KinveyRef","_collection":"collection2","_id":"someId"}

}

collection2{

name:{"_type":"KinveyRef","_collection":"collection3","_id":"someId"}

}

collection3{

name:"coolName"

}



I try to fetch data from collection1 with information from collections 2 and 3. I make request:

var promise = $kinvey.DataStore.find('collection1', null, {relations: { name:"collection2"}});

But in response I have just reference to collection3.



How I can modify my request to get info from collection3? Help me please.
1 Comment

Yes, in order to also resolve the reference to collection3, you’d have to include it in the relations option:



```

$kinvey.DataStore.find('collection1', null, {

relations: {

name: "collection2",

"name.name": "collection3"

}

});

```
Login or Signup to post a comment