您好我有以下查询我想通过检查mongoDb中的数组(存储为集合)中存在的特定Id来获取数据,如下所示: //代金券收藏:
"byLedgers": [
[
"57a578b7518459d1008b4567",
"57a30cd25184590a018b4567"
]
]
So I am running query in my repository as following:
$getAllVouchers = $dm->createQueryBuilder('EduAccountBundle:VoucherGeneration');
$getAllVouchers->field('isDeleted')->Equals(false);
$getAllVouchers->addOr($getAllVouchers->expr()->field('byLedgers')->Equals($id)); //Here how to use $in instead Equals
$getAllVouchers->addAnd($getAllVouchers->expr()->field('financialYear')->Equals($currentFinancialYear));
$resultTo = $getAllVouchers->getQuery()->execute();
我得到0结果。我需要使用$ in而不是Equals。但不知道如何使用它。请帮忙 提前致谢