Я хочу получить новые строки из модели. Строки, созданные после указанной даты. Запрос должен быть очень простым:
где 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);
});
Заранее спасибо.