查询Parse上的关系数据

时间:2016-04-21 19:30:59

标签: parse-platform cloud-code parse-server

我已经看到了有关在查询上查询关系数据的其他问题,但它们并不能满足我的需求。

我有3个相关的课程:Teacher (1->many) Course (many<-1) Category

鉴于上述结构,我想查询所有课程属于特定类别的教师。以下是我到目前为止的情况:

    var Category = Parse.Object.extend("Category");
    var category = new Category();
    category.id = "shdh43ay";

    var Course = Parse.Object.extend("Course"); //There are pointers on Course to both Teacher and Category
    var courseQuery = new Parse.Query(Course);
    courseQuery.equals('Category', category);


    var Teacher = Parse.Object.extend("Teacher");
    var teacherQuery = new Parse.Query(Teacher);
    teacherQuery.matchesQuery(); //Here is where I am stuck

它不像我看起来像matchQuery会做的伎俩,欢迎任何想法

0 个答案:

没有答案