8 Star 26 Fork 9

zzl/Smartinsight项目问卷调研子系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
db.js 639 Bytes
一键复制 编辑 原始数据 按行查看 历史
zzl 提交于 2017-08-02 14:34 +08:00 . zzl
var mongoClient = require('mongodb').MongoClient;
var poolModule = require('generic-pool');
var pool = poolModule.Pool({
name : 'mongodb',
create : function(callback) {
mongoClient.connect('mongodb://localhost:27017/smartinsight', {
server:{poolSize:1}
}, function(err,db){
callback(err,db);
});
},
destroy : function(db) { db.close(); },
max : 10,//根据应用的可能最高并发数设置
idleTimeoutMillis : 30000,
log : false
//more code here
});
//module.exports = new mongoClient(new Server('localhost', 27017));
module.exports = pool;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/git_zliang/SmartinsightXiangMuWenJuanDiaoYanZiXiTong.git
git@gitee.com:git_zliang/SmartinsightXiangMuWenJuanDiaoYanZiXiTong.git
git_zliang
SmartinsightXiangMuWenJuanDiaoYanZiXiTong
Smartinsight项目问卷调研子系统
master

搜索帮助