4
我正在使用Node.JS + Mongoose + MongoDB。曾試圖保存文檔時,我的應用程序工作確定到現在爲止,現在:MongoError:寫EPIPE
保存操作:
doc.save(function(err, d){
console.log(err,d);
{"name":"MongoError","message":"write EPIPE"}
錯誤堆棧:
{ [MongoError: server localhost:27017 received an error {"name":"MongoError","message":"write EPIPE"}]
name: 'MongoError',
message: 'server localhost:27017 received an error {"name":"MongoError","message":"write EPIPE"}' } undefined
error: TypeError: Cannot read property 'url' of undefined
at EventEmitter.<anonymous> (/home/ec2-user/c/index.js:160:61)
at EventEmitter.<anonymous> (/home/ec2-user/c/node_modules/mongoose/node_modules/mpromise/lib/promise.js:174:48)
at EventEmitter.emit (events.js:95:17)
at Promise.safeEmit (/home/ec2-user/c/node_modules/mongoose/node_modules/mpromise/lib/promise.js:81:21)
at Promise.reject (/home/ec2-user/c/node_modules/mongoose/node_modules/mpromise/lib/promise.js:109:15)
at Promise.error (/home/ec2-user/c/node_modules/mongoose/lib/promise.js:94:15)
at Promise.resolve (/home/ec2-user/c/node_modules/mongoose/lib/promise.js:112:24)
at /home/ec2-user/c/node_modules/mongoose/lib/document.js:1555:39
at handleError (/home/ec2-user/c/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:40:22)
at next_ (/home/ec2-user/c/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:75:26)
貌似我能夠讀取數據,但不能寫入新文件。 Mongo是應用程序並正在運行。到目前爲止,我已經嘗試過,重新啓動數據庫,沒有好的結果。
只是試圖從蒙戈客戶端將與合作
> db.mysecretcollection.insert({url:"sampletestremoveme"});
WriteResult({ "nInserted" : 1 })
所以這似乎是一個的Node.js /貓鼬問題。