0
我使用的Bookshelf.js ORM,我需要能够按日期和有一些问题进行查询。如何查询日期Bookshelf.js
这里是我使用的一个样本代码片段。
this.model.query((q) => {
q.where('created_at', '>=', Date.now());
q.orderBy('created_at', 'DESC');
})
.fetch().then(function (model) {
socket.send(JSON.stringify(model));
});
上面的代码只是返回一个空或空的数组。 任何想法?