Trying to open unclosed connection
来源:互联网 发布:订单数据库 编辑:程序博客网 时间:2024/04/20 00:37
重复打开了mongodb.
错误代码:
mongoose.connect('mongodb://localhost/journal');var db = mongoose.connect('mongodb://localhost/journal').connection;db.on('error',(err)=>{ db.close(); return console.error(err);});
错误原因:
上面connect了一次,下面又connect了。所以去掉。
解决方法:
mongoose.connect('mongodb://localhost/journal');var db = mongoose.connection;db.on('error',(err)=>{ db.close(); return console.error(err);});
0 0
- Trying to open unclosed connection
- failed to open gcomm backend connection: 13: error while trying to listen 'tcp:/
- 解决session 关闭问题 WARN - unclosed connection, forgot to call close() on your session?
- Unable to open sync connection
- Unable to open sync connection!
- Unable to open sync connection!
- Android:Unable to open sync connection!
- Android Unable to open sync connection
- A connection attempt failed because the connected party did not (trying to connect via tcp://localho
- Unable to open a connection to the libvirt management daemon
- "The file you are trying to open, '[filename]', is in a different format" Excel Error
- fsck.ext4:no such file directory while trying to open /dev/
- Can't open a connection to site 'SYB_BACKUP' 解决办法
- can't open a connection to site 'syb_backup' 解决
- java.io.IOException: Unable to open sync connection!的解决方案
- java.io.IOException: Unable to open sync connection!的解决方案
- java.io.IOException: Unable to open sync connection!
- 如何解决:java.io.IOException: Unable to open sync connection!
- SQLi Labs Lesson23
- qt ignore()和accept()函数
- 【TBB】缺少MSVCR80问题
- 机器学习-贝叶斯分类
- 遇见C++ Lambda
- Trying to open unclosed connection
- 透明度与十六进制代码转换
- hdu 5853 Jong Hyok and String (二分+后缀数组+RMQ)
- 装饰(Decorator)——对象结构型模式
- 一致性哈希
- 【JZOJ4709】【NOIP2016提高A组模拟8.17】Matrix
- 增强图像细节(附C++代码)
- OpenSceneGraph实现的NeHe OpenGL教程 - 第四十二课
- jQuery选择器详解