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.
我有一篇文章文档,我跟踪阅读次数。现在我想运行一个查询,该查询将返回具有最高阅读计数的文章。
我将如何使用原则 odm 来解决这个问题?
谢谢
还没有真正经常使用 ODM,但我相信你可以这样做:
$dm->createQueryBuilder('Article')->sort('readCount', 'desc')->limit(1)->getQuery()->execute();