SequelizeInstance对象不在Express Handlebars视图中呈现(NodeJS,Express)

使用NodeJS,Express和Sequilize,

当我用res.render()调用实际数据实例值的时候,我正在渲染视图[对象SequelizeInstance:Todo],但是当被.send调用时(参见下面的注释行),数据实例值被发送到视图。

exports.test_todo_view = function(req, res) { return Todo .findAll({ //attributes: ['id'] //select fields }) //.then((todos) => res.status(200).send(todos)) .then((todos) => res.render('test/test_view', {layout: 'ca_layout.handlebars', test_data: todos})) .catch((error) => res.status(400).send(error)); } 

输出是数据库中每个条目的[object SequelizeInstance:Todo]。

任何人都可以build议吗? 它工作,即我可以看到数据 – [{“id”:1,“title”:“fasdfsd”,“createdAt”:“2017-11-15”,…]当我使用.send(todos)如图所示。

我正在使用以下来调用视图。

 app.get('/test/view', authCarePlan.test_todo_view); 

我的.handlebars文件看起来像这样

 <div>test_data:{{test_data}}</div> 

我希望查询输出通过test_data

.handlebars视图中需要以下configuration

 {{#test_data}} {{title}} {{/test_data}} 

其中test_data是variables占位符的名称,title是其中的字段的名称。