I have 2 tables in database.
User table
Courses table
Im trying to get students of certain course which has the instructor with name “dummyName”.
Moralis.Cloud.define("course_relation", async (request) => {
courses = Moralis.Object.extend("Courses")
const relation = courses.relation("Instructor");
result = await relation.query().equalTo("Name","dummyName").find({useMasterKey: true});
return result;
});
this code gives “courses.relation is not a function” error.