【发布时间】:2014-08-11 17:42:31
【问题描述】:
我想从模型中获取 new 行。在给定日期之后创建的行。查询应该很简单:
其中 updatedAt >= givenDate
但它不起作用:(
我的代码:
// Date from client
var lastDate = req.param("date");
// Parse date with moment? I have tried with and without this.
lastDate = moment(lastDate).format('YYYY-MM-DD hh:mm:ss');
var query = Message.find().where({
updatedAt: {
'>=': lastDate
}
});
query.exec(function(err, messages) {
// I get ALL the messages, :(
res.send(messages);
});
提前致谢。
【问题讨论】:
标签: node.js sails.js waterline