src/Query/Runner.php
protected function getFreshNormal($wheres)
    {
        $columns = [];

        // Convert select columns to simple projections.
        foreach ($this->columns as $column) {
            $columns[$column] = true;
        }

        // Add custom projections.
        if ($this->projections) {
            $columns = array_merge($columns, $this->projections);
        }
        $options = [];

        // Apply order, offset, limit and projection
        //if ($this->timeout) {
        //    $options['maxTimeMS'] = $this->timeout;
        //}
        if ($this->orders) {
            $options['sort'] = $this->compileOrders($this->orders);
        }
        if ($this->offset) {
            $options['skip'] = $this->offset;
        }
        if ($this->limit) {
            $options['limit'] = $this->limit;
        }
        if ($columns) {
            $options['projection'] = $columns;
        }
        // if ($this->hint)    $cursor->hint($this->hint);

        // Fix for legacy support, converts the results to arrays instead of objects.
        $options['typeMap'] = ['root' => 'array', 'document' => 'array'];

        // Add custom query options
        if (count($this->options)) {
            $options = array_merge($options, $this->options);
        }

        // Execute query and get MongoCursor
        $cursor = $this->collection->find($wheres, $options);

        // Return results as an array with numeric keys
        $results = iterator_to_array($cursor, false);

        return $results;
    }
protected function getFreshNormal($wheres)
    {
        $columns = [];

        // Convert select columns to simple projections.
        foreach ($this->columns as $column) {
            $columns[$column] = true;
        }

        // Add custom projections.
        if ($this->projections) {
            $columns = array_merge($columns, $this->projections);
        }
        $options = [];

        // Apply order, offset, limit and projection
        //if ($this->timeout) {
        //    $options['maxTimeMS'] = $this->timeout;
        //}
        if ($this->orders) {
            $options['sort'] = $this->compileOrders($this->orders);
        }
        if ($this->offset) {
            $options['skip'] = $this->offset;
        }
        if ($this->limit) {
            $options['limit'] = $this->limit;
        }
        if ($columns) {
            $options['projection'] = $columns;
        }
        // if ($this->hint)    $cursor->hint($this->hint);

        // Fix for legacy support, converts the results to arrays instead of objects.
        $options['typeMap'] = ['root' => 'array', 'document' => 'array'];

        // Add custom query options
        if (count($this->options)) {
            $options = array_merge($options, $this->options);
        }

        // Execute query and get MongoCursor
        $cursor = $this->collection->find($wheres, $options);

        // Return results as an array with numeric keys
        $results = iterator_to_array($cursor, false);

        return $results;
    }
protected function getFreshNormal ( $ wheres ) { $ columns = [ ] ; // Convert select columns to simple projections. foreach ( $ this -> columns as $ column ) { $ columns [ $ column ] = true ; } // Add custom projections. if ( $ this -> projections ) { $ columns = array_merge ( $ columns , $ this -> projections ) ; } $ options = [ ] ; // Apply order, offset, limit and projection //if ($this->timeout) { //    $options['maxTimeMS'] = $this->timeout; //} if ( $ this -> orders ) { $ options [ 'sort' ] = $ this -> compileOrders ( $ this -> orders ) ; } if ( $ this -> offset ) { $ options [ 'skip' ] = $ this -> offset ; } if ( $ this -> limit ) { $ options [ 'limit' ] = $ this -> limit ; } if ( $ columns ) { $ options [ 'projection' ] = $ columns ; } // if ($this->hint)    $cursor->hint($this->hint); // Fix for legacy support, converts the results to arrays instead of objects. $ options [ 'typeMap' ] = [ 'root' => 'array' , 'document' => 'array' ] ; // Add custom query options if ( count ( $ this -> options ) ) { $ options = array_merge ( $ options , $ this -> options ) ; } // Execute query and get MongoCursor $ cursor = $ this -> collection -> find ( $ wheres , $ options ) ; // Return results as an array with numeric keys $ results = iterator_to_array ( $ cursor , false ) ; return $ results ; }
Fetch Normal.

@param $wheres
@return \mixed[]
Fetch Normal .