Node.JS にオブジェクト配列があり、response.write(); を使用したいです。それを画面に表示すると、最初のオブジェクトを取得できますが、ループが停止し、最初のオブジェクトのみが出力されます。誰かが私を正しい方向に向けることができます...
db.collection('todo', function(err, collection){
collection.find(function(err, cursor) {
cursor.each(function(err, doc) {
for(docs in doc){
if(docs == "_id"){
}else{
var test = docs + " : " + doc[docs];
}
}
data = data.toString("utf8").replace("{{TEST}}", test);
response.write(data);
response.end();
})
});
});