Skip to content

order in select query #148

@bakhodir10

Description

@bakhodir10

https://github.com/goodybag/mongo-sql/blob/master/docs/query-helpers.md#helper-order

Here is documentation and there is written
// select "users".* from "users" order by "order"."id" desc, "order"."name" asc
{
type: 'select'
, table: 'users'

// Object syntax is the preferable way since it can automatically
// quote your columns and add in the default table
, order: { id: 'desc', name: 'asc' }
, order: ['id desc', 'name asc']
, order: 'id desc'
}
but when I use
order: { id: 'desc', name: 'asc' }
it shows the error that
"{ error: syntax error at or near "order".
Then I tested
orderBy: { id: 'desc', name: 'asc' } and it is working correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions