Start a new topic
Answered

List items who have reference for object

Hi guys,i has two collections.First is Country(has property name) and second is Town(has property name,and country).If i wanted to take country name on city my hhtp requst is 
/appdata/..../Town/id?resolve=country.But how i taked all towns for country with country id ?


Best Answer
Dimitar,

You can achieve this by implementing onPostFetch() hook for Country collection. In that hook, query the Towns collection for all towns given this country and then insert the resulting json in the output response.

Thanks,
Pranav
Kinvey Support

 

1 Comment

Answer
Dimitar,

You can achieve this by implementing onPostFetch() hook for Country collection. In that hook, query the Towns collection for all towns given this country and then insert the resulting json in the output response.

Thanks,
Pranav
Kinvey Support

 

Login or Signup to post a comment