【发布时间】:2017-05-16 00:33:51
【问题描述】:
我需要获取两次之间创建的对象的列表;
我可以通过编写 SQL 查询来获取数据;
但是我需要通过书架来写这个查询;
我的简单查询:
router.route('/locations')
// fetch all locations
.get(function (req, res) {
Locations.forge()
.fetch()
.then(function (collection) {
res.json({error: false, data: collection.toJSON()});
})
.catch(function (err) {
res.status(500).json({error: true, data: {message: err.message}});
});
})
我怎样才能像上面的查询一样获得两个日期之间的位置?
【问题讨论】:
标签: mysql node.js database bookshelf.js