【发布时间】:2018-05-18 21:55:20
【问题描述】:
这是我的服务器代码:
router.route('/addComment')
.post(function(req, res) {
appRequest.update({"_id": req.body._id}, {$push:{comments:req.body.comments}}) // appRequest is my collection
});
我是这样定义我的收藏的:
var locations = new mongoose.Schema({
title: {
type: String,
required: true,
},
comments: [{
identifier: String,
text: String
}]
});
我想更新 cmets 并将用户新评论附加到 cmets 数组。
当我尝试调用/addComment URL 时,我在日志中得到以下信息(我将它托管在 Heroku 中):
at=错误代码=H12 desc="请求超时" 方法=POST path="/addComment" 主机=折扣-oman.herokuapp.com request_id=f77cc261-e58a-4eea-a7ad-f74af57972f4 fwd="94.185.30.228" dyno=web.1 连接=0ms 服务=30010ms 状态=503 字节=0 协议=https
我在这里做错了什么?
【问题讨论】:
标签: node.js mongodb meteor heroku mongoose