路线(来自postgres的数据):
If IsNull(DLookup("[Patient ID]", "Patients", "[Patient ID]='" & Me.Patient_ID & "'")) Then MsgBox "does not exist"
玉:
//show books
pg.connect(dbconnect, function(err, client, done) {
client.query('SELECT * FROM books', function(err, result) {
res.render('books', { title: 'My Books', booklist: JSON.stringify(result.rows) });
});
});
输出:
block content
each key in booklist
p= bookname
任何帮助表示赞赏!
答案 0 :(得分:2)
问题可能是您将对象转换为JSON.stringify()
的字符串。该函数将返回一个字符串,然后您尝试迭代它。
尝试
pg.connect(dbconnect, function(err, client, done) {
client.query('SELECT * FROM books', function(err, result) {
res.render('books', { title: 'My Books', booklist: result.rows });
});
});
和
block content
each book in booklist
p= book.bookname