.query()

.query() is only available on Sails/Waterline models using a SQL database (PostgreSQL and mySQL) adapter. Its purpose is to perform raw SQL queries.

Example

Pet.query('SELECT pet.name FROM pet', function(err, results) {
  if (err) return res.serverError(err);
  return res.ok(results.rows);
});

Notes

This method only works with PostgreSQL and mySQL! use .native() for Mongo.