chenyongze/think-mongo

mongodb driver for thinkphp5

v1.6 2017-02-13 07:17 UTC

This package is not auto-updated.

Last update: 2024-11-16 13:41:39 UTC


README

首先安装官方的mongodb扩展:

http://pecl.php.net/package/mongodb

然后,配置应用的数据库配置文件database.phptype参数和query参数为:

'type'   =>  '\think\mongo\Connection',
'query'  =>  '\think\mongo\Query',

即可正常使用MongoDb,例如:

Db::name('demo')
    ->find();
Db::name('demo')
    ->field('id,name')
    ->limit(10)
    ->order('id','desc')
    ->select();