ModelBundle/Repository/KeywordRepository.php
public function removeKeywords(array $keywordIds)
    {
        array_walk($keywordIds, function(&$keywordId) {$keywordId = new \MongoId($keywordId);});

        $qb = $this->createQueryBuilder();
        $qb->remove()
            ->field('id')->in($keywordIds)
            ->getQuery()
            ->execute();
    }
public function removeKeywords(array $keywordIds)
    {
        array_walk($keywordIds, function(&$keywordId) {$keywordId = new \MongoId($keywordId);});

        $qb = $this->createQueryBuilder();
        $qb->remove()
            ->field('id')->in($keywordIds)
            ->getQuery()
            ->execute();
    }
@param array $keywordIds

@throws \Doctrine\ODM\MongoDB\MongoDBException