Very similar to #304 , it would be nice to be able to order by some raw (but properly escaped) SQL. My case is: ``` javascript cities.find().order("ST_Distance(geopoint, ?)", [point]).limit(1); ``` Two problems with this; first, it doesn't take ? and a list. Second, even a properly formed query gets quoted like it's an identifier.
Activity
dxg commentedon Aug 28, 2013
This is on the TODO list and will be implemented soon.
dxg commentedon Sep 10, 2013
This is a bit tricky if we want to reuse the
orderfunction because in this case:"name ASC"will be treated as a property name and mangled into invalid SQL, whereaswill have a different signature and hence be treated as SQL and escaped properly.
We might have to add another function like
orderRawororderSql:-\Allow ordering by escaped sql
Allow ordering by escaped sql
Allow ordering by escaped sql
Merge pull request #332 from dresende/order-sql