Hello there
I’m trying to fetch all projects including their creator with a single query in a cloud function. The creator is a User type object and I cannot seem to fetch any user other than the logged in one. I’ve read that I need to use {useMasterKey:true}
when fetching the data, but have only seen it used as a parameter to find()
. I tried adding in inside include as well but it does not seem to work.
This is what I’ve attempted:
Moralis.Cloud.define("getProjectsWithCreator", (request) => {
const query = new Moralis.Query("Project");
query.include("user", {useMasterKey:true});
return query.find({useMasterKey:true})
});
});
I’d appreciate your help