src/Repository.php
public function findAndModifyOneBy($filters = [], $update = [], $projections = [], $sorts = [], $options = [])
    {

        $options = $this->createOption($projections, $sorts, $options);

        $filters = $this->castQuery($filters);
        $update = $this->castQuery($update);

        $result = (array) $this->collection->findOneAndUpdate($filters, $update, $options);

        return $this->createObject($result, $options);
    }
public function findAndModifyOneBy($filters = [], $update = [], $projections = [], $sorts = [], $options = [])
    {

        $options = $this->createOption($projections, $sorts, $options);

        $filters = $this->castQuery($filters);
        $update = $this->castQuery($update);

        $result = (array) $this->collection->findOneAndUpdate($filters, $update, $options);

        return $this->createObject($result, $options);
    }
public function findAndModifyOneBy ( $ filters = [ ] , $ update = [ ] , $ projections = [ ] , $ sorts = [ ] , $ options = [ ] ) { $ options = $ this -> createOption ( $ projections , $ sorts , $ options ) ; $ filters = $ this -> castQuery ( $ filters ) ; $ update = $ this -> castQuery ( $ update ) ; $ result = ( array ) $ this -> collection -> findOneAndUpdate ( $ filters , $ update , $ options ) ; return $ this -> createObject ( $ result , $ options ) ; }
Find a document and make specified update on it

Options :
*   readOnly : boolean - When false, flush will not update object
@see MongoDB\Operation\FindAndModify::__construct for more option

@param   array                   $filters            Filters
@param   array                   $update             Update to perform
@param   array                   $projections        Projection of the query
@param   array                   $sorts              Sorts specification
@param   array                   $options            Options for the query
@param array $options
@return void
Find a document and make specified update on it