0
我目前有一個class
調用活動和另一個調用視頻。用parse.com在一個查詢中獲取兩個類
Activity class
包含對象ID的視頻class
。
當我查詢8個活動行和其相關的視頻,它在很大程度上減慢我的PHP腳本從1秒下來,周圍10秒。
有沒有一種方法可以查詢一行中的兩個類,如MySQL
join
查詢?
Hereis我的代碼
$query = new ParseQuery("Activity");
$query->containedIn("type","video");
$query->limit($limit);
$comments = $query->find();
if(!$queryResults){
return false;
}
foreach($queryResults as $result){
if($result->get("type") == "post"){
$content = array(
"objectId" => $contentQuery->getObjectId(),
"name" => $contentQuery->get("name"),
"location" => $contentQuery->get("location")
);
}
$return[] = array(
"activityObjectId" => $result->getObjectId(),
"type" => $result->get("type"),
"content" => $content,
"user" => $this->user,
"createdAt" => $result->get("createdAt")
);
}
謝謝, 彼得
你應該喜歡的代碼在這個問題上提供更多的信息開始**活動**或您正在使用的**查詢**。 –
不是因爲這個問題的性質,我認爲這是必要的,但我已經添加了我的代碼。 –
解析不允許您交叉查詢類,因爲它們是從API請求收集收入的業務。 Parse確實有一個orQueryWithSubQueries,但是它又不是用於交叉引用不同的類 – soulshined