0

所以我在一个连接到 Kinvey 后端的 AngularJs 应用程序中工作。www.kinvey.com

在 Kinvey 中,我们可以获取一个实体及其关系,如下所示:

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

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

关系数据/获取

上面实际上是从事件集合中获取一个事件实体,它还获取与其关联的位置的数据(它们在不同的集合中),到目前为止,我们能够检索一个实体及其关联的实体...... .

现在我怎样才能检索这些位置的关联?
换句话说,我如何检索嵌套关联?

谢谢。

4

1 回答 1

0

像这样:

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

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

于 2014-10-29T00:39:52.197 回答