节点mongodb:错误:由于parseError关闭了连接 [英] Node mongodb: Error: connection closed due to parseError
本文介绍了节点mongodb:错误:由于parseError关闭了连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用本地的"mongodb" npm软件包,我收到
Using the native 'mongodb' npm package, I'm receiving
Error: connection closed due to parseError
进行非常基本的查询时:
When making a very basic query:
collections.myCollection.findOne({id: someID}, function (err, repo) {
...
})
奇怪的是,之前已经运行过完全相同的查询.每个查询的类型均相同,等等.
The weird thing is, the exact same query has run before. Types are identical for each query, etc.
推荐答案
回答我自己的问题,以希望阻止下一个人扯掉头发:
Answering my own question to hopefully stop the next person from tearing their hair out:
如此处所述,要查找实际的错误是什么:
To find what the error actually is:
-
打开您的
node_modules/mongodb
找到server.js
寻找mongoReply.parseBody
登录err
可以看到实际上有用的内容.
log the err
to see something actually useful.
就我而言:
ReferenceError: collection is not defined
编辑: Node MongoDB本机1.4现在稳定,并包含对此错误的修复程序.
Edit: Node MongoDB native 1.4 is now stable, and includes a fix to this bug.
这篇关于节点mongodb:错误:由于parseError关闭了连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文