私はあなたがポインタまたは関係としてproduction
セットアップを持っているかどうかわからないんだけど、私はあなたのためにここの両方について詳しく説明します。
ポインタ(1-1)のようにクエリを調整する必要があります。 関係(1対多)として
$query = new ParseQuery('Album');
// include the nested object under 'production'
$query->includeKey('production');
// get albums with Production set under 'production'
$albums = $query->find();
あなたは、関連するすべてのproduction
オブジェクトを取得するための別のクエリを作成する必要があります。
$relation = $albums->getRelation('production'); // can add Production as the class name as 2nd arg if you have issues
$relationQuery = $relation->getQuery();
// get all Production objects
$productions = $relationQuery->find();
あなたが継続的にあなたがダウンし、約2クエリにあなたのオーバーヘッドを減らすことができ、各Album
ため、この関係クエリを作っている場合。 Production
にポインタを追加して、親のAlbum
に戻り、ParseQuery::orQueries
を使用してすべてという便利なクエリにクエリを結合します。
// get albums
$query = new ParseQuery('Album');
$albums = $query->find();
// get each relation query for each album
$queries = [];
foreach($albums as $album) {
$relation = $album->getRelation('production', 'Production');
$queries[] = $relation->getQuery();
}
// combine your relation queries
$query = ParseQuery::orQueries($queries);
// include the parent 'album' pointer so we can
// sort which objects belong where
$query->includeKeys('album');
// get these productions
$productions = $query->find();
またmatchesKeyInQuery
でいくつかのものを行うことができ、私はそれにいくつかの詳細を取得するdocs上に読みになることをお勧めします。
誰でも助けることができますか? – sony