think-mongo icon indicating copy to clipboard operation
think-mongo copied to clipboard

mongodb driver for thinkphp

Results 25 think-mongo issues
Sort by recently updated
recently updated
newest added

https://github.com/top-think/think-mongo/blob/4e01004af05d7c5d7f938ce1a70b6e8f08b265a0/src/Builder.php#L525 应该单独判断“ ['$group' => ['_id' => $group, 'aggregate' => **['$' . $fun => '$' . $field]]]**,”中的$fun,如果时统计,可以直接设置为['$sum' => 1],否则当field字段为非数字时无法统计。 我的解决方法是: if ($fun == 'count') { $pipeline = [ ['$match' => (object)...

5.1的vendor/topthink/think-mongo/src/Connection.php:188 ` $host = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : ''); ` 5.0的vendor/topthink/think-mongo/src/Connection.php:154 ` $host =...

![_20180630161039](https://user-images.githubusercontent.com/17748894/42123192-29ee957a-7c80-11e8-96a3-3eb3eb69eeb3.png) 正确的副本集链接形式应该是这样的 客户端使用Connection String URI连接实例 (****部分替换为为root密码): mongodb://root:****@dds-322131231312-pub.mongodb.rds.aliyuncs.com:3717,dds-132132313213123213-pub.mongodb.rds.aliyuncs.com:3717/admin?replicaSet=mgset-7170979

2.0版本的Builder.php的396行获取到的数据为空数组 ,应该改为$data = $this->parseData($query, $data);

优化multiAggregate操作,对于一个聚合操作,支持传入多个字段 例子: ``` $tableName = 'table_name'; Db::connect(config('mongo'))->name($tableName) ->multiAggregate(['sum' => ['field_sum', 'field_sum_2'], 'max' => ['study_date_year', 'study_date_year2'], 'min' => ['study_date_year', 'study_date_year2']], ['tea_strength', 'tea_changes_per_day']; ```

tp5 framework 升级是不是太随意了,每次升级原来的代码总会出各种问题 。

$res = model('test')->where($w)->select(); // $t = new Test(); 方法不存在:think\mongo\Query->setQuery

保存数据不支持upsert

whereTime('time','last month') case 'last month': $range = [date('y-m-01', strtotime('-1 month')), mktime(0, 0, 0, $date['mon'], 1, $date['year'])]; break; range为上个月范围,但是返回的区间一个是字符串,一个是时间戳... 是不是左边也要mktime..