node.js - SOLVED Waterline (Sails.js). Rows with 'updatedAt' greater than a given value -



node.js - SOLVED Waterline (Sails.js). Rows with 'updatedAt' greater than a given value -

i want new rows model. rows have been created after given date. query should easy:

where updatedat >= givendate

but it's not working :(

my code:

// date client var lastdate = req.param("date"); // parse date moment? have tried , without this. lastdate = moment(lastdate).format('yyyy-mm-dd hh:mm:ss'); var query = message.find().where({ updatedat: { '>=': lastdate } }); query.exec(function(err, messages) { // messages, :( res.send(messages); });

thanks in advance.

solved.

i created date instance , passed clause:

// date client: date in ms (new date().gettime()) var lastdate = req.param("date"); // create date lastdate = new date(lastdate); var query = message.find().where({ updatedat: { '>=': lastdate } }); query.exec(function(err, messages) { // messages, :( res.send(messages); });

node.js sails.js waterline

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -