如何在EJS模板中显示从mongodb数据库检索的数据

时间:2019-07-24 16:12:01

标签: node.js mongodb ejs

从mongodb数据库中检索数据后,结果如下:

{ "_id" : "100", "Test" : [ { "disposition" : "ANSWERED", "count" : 4, "duration" : 444, "billsec" : 419 }, { "disposition" : "BUSY", "count" : 3, "duration" : 28, "billsec" : 0 } ] }
{ "_id" : "101", "Test" : [ { "disposition" : "ANSWERED", "count" : 1, "duration" : 250, "billsec" : 200 }, { "disposition" : "BUSY", "count" : 3, "duration" : 28, "billsec" : 0 }] }

我希望使用EJS模板以以下格式将数据放入表中: enter image description here

我使用了2个循环,但正确显示了所需的格式

0 个答案:

没有答案