'MONGO_DB' => array(
'db_type' => 'mongo',
'db_host' => 'mini-server.endaosi.com',
'db_user' => 'endaosi',
'db_pwd' => 'aaaa123456',
'db_port' => '27017',
'db_name' => 'shcms',
)
使用,具体参见:http://document.thinkphp1.cn/manual_3_2.html#mongo$model = M('\Think\Model\MongoModel:User','',MONGO_DB);
$result = $model -> add(['a'=>'abc','b'=>'123']);
$result = $model -> add(['email'=>'shellus@vip.qq.com');
dump($model -> count());
dump($model -> select());
至此,mongodb在tp中使用就大功告成了。AD:真正免费,域名+虚机+企业邮箱=0元