我想删除所有带有字段的文档,而不是我拥有的id数组。当我尝试时,它只是从我的数据库中删除所有内容。
这是我的代码:
public function removeNotInListingIdList($ids, $country) {
$dm = $this->getDocumentManager();
$dm->createQueryBuilder('DnDReactivePandoraBundle:Property')
->remove()
->field('listingId')->notIn($ids)
->field('country', $country)
->getQuery()
->execute();
}
我在这里做错了什么?
更新
这是 debug 指令的输出:
Array
(
[type] => 3
[query] => Array
(
[listingId] => Array
(
[$nin] => Array
(
[0] => 15-77
[1] => 15-79
[2] => 15-82
[3] => 13-39
[4] => 15-85
[5] => 15-86
[6] => 15-60
[7] => 15-61
[8] => 16-8
)
)
[country] => Mexico
)
[newObj] => Array
(
)
)
答案 0 :(得分:1)
您的国家/地区构造不正确。应该是:
type Props = {
children: React.ReactNode
}
export const LMenuItem = ({children}: Props) => (
<div>{children}</div>
)