ModelBundle/Repository/NodeRepository.php
public function updateUseReference($referenceNodeId, $nodeId, $siteId, $entityType)
    {
        $this->createQueryBuilder()
            ->updateMany()
            ->field('nodeId')->equals($nodeId)
            ->field('siteId')->equals($siteId)
            ->field('useReferences.'.$entityType.'.'.$referenceNodeId)->set($referenceNodeId)
            ->getQuery()
            ->execute();
    }
public function updateUseReference($referenceNodeId, $nodeId, $siteId, $entityType)
    {
        $this->createQueryBuilder()
            ->updateMany()
            ->field('nodeId')->equals($nodeId)
            ->field('siteId')->equals($siteId)
            ->field('useReferences.'.$entityType.'.'.$referenceNodeId)->set($referenceNodeId)
            ->getQuery()
            ->execute();
    }
@param string $referenceNodeId
@param string $nodeId
@param string $siteId
@param string $entityType

@throws \Doctrine\ODM\MongoDB\MongoDBException