open-orchestra/open-orchestra-model-bundle

Open Orchestra模型接口的MongoDB实现


README

Open Orchestra模型包

使用方法

安装包后,您应该在AppKernel::registerBundles()中也激活聚合查询包

new OpenOrchestra\ModelBundle\OpenOrchestraModelBundle(),
new Solution\MongoAggregationBundle\SolutionMongoAggregationBundle(),

这将允许您通过以下方法在存储库中创建聚合查询

AbstractRepository::createAggregationQuery()

使用聚合,MongoDB不返回原始文档,但通过使用$$ROOT参数,您可以向响应中添加文档的所有字段。

要使用数据库结果填充所有文档,请使用以下方法

AbstractRepository::hydrateAggregateQuery()