0

So I'm working in an AngularJs app that is connected to a Kinvey backend. www.kinvey.com

In Kinvey we can fetch an entity and it's relations like this:

var promise = $kinvey.DataStore.get('events', 'event-id', {
    relations : { location: 'locations' }
});

http://devcenter.kinvey.com/angular/guides/datastore#JoiningOperators

Relational Data / Fetching

The above is actually getting an event entity from the events collection and it's also fetching the data of the locations associated to it (which are in a different collection), so far so good we are able to retrieve an entity and it's associated entities ...

Now how could I retrieve the associations of those locations ?
In other words how can I retrieve nested associations ?

Thanks.

code4jhon
  • 5,725
  • 9
  • 40
  • 60

1 Answers1

0

Like this:

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

https://support.kinvey.com/discussion/201272198/nested-relations

code4jhon
  • 5,725
  • 9
  • 40
  • 60