当前位置:Gxlcms > 数据库问题 > 安装使用mongodb

安装使用mongodb

时间:2021-07-01 10:21:17 帮助过:3人阅读

db_mongo => [ type => \think\mongo\Connection, query => \think\mongo\Query, hostname => localhost, database => elevatormonitor, username => ‘‘, password => ‘‘, hostport => 27017, dsn => ‘‘, // 数据库连接参数 params => [], // 数据库编码默认采用utf8 charset => utf8, // 数据库表前缀 prefix => ‘‘, ],

然后使用的时候怎么用?

$mongo_conn=db::connect("db_mongo");
$insertdata1=["_id"=>1,server_name=>"test", server_state=>0,server_url=>http://localhost/xxx];
$mongo_conn->name("t_image_server")->insert($insertdata1);

#链接和插入
#类似于Db::query(“db.t_image_server.find()")这样的语句暂时不会用,只会用tp封装的查询方法,,囧

 

安装使用mongodb

标签:cal   param   connect   span   失败   from   article   mysq   min   

人气教程排行