email: req.params.email, created: (new Date()).getTime() }).run(r.conn); }) .get('/message', function (req, res) { // ... }) Run the query HTTP endpoints with Node.js
function (req, res) { return r.table('messages') .orderBy({ index: 'created'}) .coerceTo('array') .run(r.conn) .then(function (messages) { res.json(messages); }); }) Order by time created HTTP endpoints with Node.js