2017-02-07 02:56:58 -05:00

24 lines
424 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

ThinkPHP 5.0 MongoDb驱动
===============
首先安装官方的mongodb扩展
http://pecl.php.net/package/mongodb
然后,配置应用的数据库配置文件`database.php``type`参数为:
~~~
'type' => '\think\mongo\Connection',
~~~
即可正常使用MongoDb例如
~~~
Db::name('demo')
->find();
Db::name('demo')
->field('id,name')
->limit(10)
->order('id','desc')
->select();
~~~