thinkphp5.1连接mongodb报错

浏览:1452 发布日期:2018/04/03 分类:ThinkPHP5专区
已经安装最新5.1.7和mongodb扩展
$data = Db::name('call')->find();
dump($data);
这样查询,报错Declaration of think\mongo\Query::inc($field, $step = 1) should be compatible with think\db\Query::inc($field, $step = 1, $op = 'INC')配置如下'type'        => '\think\mongo\Connection',
        // 设置查询类
        'query'             => '\think\mongo\Query',
        // 服务器地址
        'hostname'    => env('mongodb.hostname'),
        // 数据库名
        'database'    => env('mongodb.database'),
        // 数据库用户名
        'username'    => env('mongodb.username'),
        // 数据库密码
        'password'    => env('mongodb.password'),
        // 端口
        'hostport'    => env('mongodb.hostport'),
        //转换_id成id
        'pk_convert_id'  => true,
最佳答案
评论( 相关
后面还有条评论,点击查看>>