public function findAndRemove()
    {
        $mongoDocument = $this->collection->getMongoCollection()->findAndModify(
            $this->expression->toArray(),
            null,
            $this->projection,
            array(
                'remove' => true,
                'sort' => $this->sort,
            )
        );

        if (empty($mongoDocument)) {
            return null;
        }

        return $this->collection->hydrate(
            $mongoDocument,
            $this->isDocumentPoolUsed()
        );
    }
public function findAndRemove()
    {
        $mongoDocument = $this->collection->getMongoCollection()->findAndModify(
            $this->expression->toArray(),
            null,
            $this->projection,
            array(
                'remove' => true,
                'sort' => $this->sort,
            )
        );

        if (empty($mongoDocument)) {
            return null;
        }

        return $this->collection->hydrate(
            $mongoDocument,
            $this->isDocumentPoolUsed()
        );
    }
public function findAndRemove ( ) { $ mongoDocument = $ this -> collection -> getMongoCollection ( ) -> findAndModify ( $ this -> expression -> toArray ( ) , null , $ this -> projection , array ( 'remove' => true , 'sort' => $ this -> sort , ) ) ; if ( empty ( $ mongoDocument ) ) { return null ; } return $ this -> collection -> hydrate ( $ mongoDocument , $ this -> isDocumentPoolUsed ( ) ) ; }
Get document instance and remove it from collection

@return \Sokil\Mongo\Document
Get document instance and remove it from collection