我正在使用 Parse.com,我在数据浏览器中有以下表格:User(默认用户表格)和 studyYears。在我的用户表中,我有多个用户。我在用户表中添加了一个关系类型的列,该列引用另一个名为 studyYears 的表。 studyYears 表只包含一个名为 year 的字符串列。
我如何进行查询,以便为用户从 studyYears 表的年份列中获取值?
我希望有人能理解我想要得到的东西。提前致谢!
最佳答案
http://blog.parse.com/2012/05/17/new-many-to-many/状态:
When you fetch the Place object, the objects in the relations won’t be fetched, which is a huge win for a relationship with a large number of objects. Even without fetching all the objects in the relation, you can add objects to the relation using add:. If you wanted to fetch all the objects in the relations, you would do something like:
PFRelation *relation = [place relationForKey:@"likes"];
PFQuery *query = [relation query];
[query findObjectsInBackgroundWithBlock:^(NSArray *results, NSError *error) {
// results contains all the people who liked Sid's BBQ.
}];
关于iphone - 如何使用 parse.com 访问关系中的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16336966/