0
私はこのコードに問題があります。何らかの理由で、タイトルにエラーが表示されます。私はこれが非同期の概念の問題だと確信しています。これをどうすれば解決できますか? null
あるほとんどの場合、あなたが(いない最後に)あなたのfind()
リスト内のアイテムを持っているExpressエラー:終了後に書き込み
pokeRouter.get('/sightings/:value([a-z]+)', function (req, res) {
var test = {};
pokemon.find().each(function(err, item) {
if (item == null) {
res.end();
} else if ((req.params.value == item.type1) || (req.params.value == item.type2)) {
sightings.find({pokedex_id: item._id}).toArray(function(err, docs) {
if (docs == null) {
return null;
}
res.write(JSON.stringify(docs));
});
}
});
});
「ポケモン」と「目撃」はどこから来ていますか? – idbehold