colly_wyx
2018-05-29 d479d9fbcb37f8b861031c94a83d0e37761210c5
application/core/System/Db/Mongo.php
@@ -330,6 +330,7 @@
        $query = $this->_parseId($query);
        // 结果集偏历
        $cursor  = $col->find($query,$fields);
        // 排序
        if($sort){
            $cursor->sort($sort);
@@ -507,6 +508,21 @@
    }
    /**
     * 聚合
     * @param  [type] $colName [description]
     * @param  [type] $params  [description]
     * @return [type]          [description]
     */
    public function aggregate($colName, $params){
        $col = $this->_getCol($colName);
        // 自动处理 '_id' 字段
        //$query = $this->_parseId($query);
        $result = $col->aggregate($params);
        return $result['result'];
    }
    /**
     * 返回最后的错误信息
     *
     * @return array
@@ -538,5 +554,6 @@
        }
        return $arr;
    }
}//End Class
?>