Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
記事のドキュメントがあり、そのドキュメントの読み取り回数を追跡しています。ここで、読み取り回数が最も多い記事を返すクエリを実行したいと考えています。
doctrine odmを使用してこれを行うにはどうすればよいですか?
ありがとう
ODM はまだそれほど頻繁には使用していませんが、次のようにできると思います。
$dm->createQueryBuilder('Article')->sort('readCount', 'desc')->limit(1)->getQuery()->execute();