public function find($id, array $filters = [])
    {
        $qb = $this->dm->createQueryBuilder($this->document);

        if (count($filters)) {
            $qb = $this->addFilters($qb, $filters);
        }

        $qb->field('_id')->equals(new \MongoId($id));

        return $qb->getQuery()->getSingleResult();
    }
public function find($id, array $filters = [])
    {
        $qb = $this->dm->createQueryBuilder($this->document);

        if (count($filters)) {
            $qb = $this->addFilters($qb, $filters);
        }

        $qb->field('_id')->equals(new \MongoId($id));

        return $qb->getQuery()->getSingleResult();
    }
public function find ( $ id , array $ filters = [ ] ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> document ) ; if ( count ( $ filters ) ) { $ qb = $ this -> addFilters ( $ qb , $ filters ) ; } $ qb -> field ( '_id' ) -> equals ( new \ MongoId ( $ id ) ) ; return $ qb -> getQuery ( ) -> getSingleResult ( ) ; }
Find a document with support for conditions

@param array $filters List or conditional selectors http://bit.ly/1efirww

@example filters

[
[
'field' => 'id',
'selector' => 'equals',
'value' => 12
],
…
]

@return MongoCursor
Find a document with support for conditions