Laravel-mongodb: orderByRaw no support for mongodb

Created on 20 Apr 2016  路  3Comments  路  Source: jenssegers/laravel-mongodb

http://stackoverflow.com/questions/36594239/orderbyraw-not-working-with-jenssegers-mongodb-laravel-5

Can you please give me a suggestion or any other method for sorting the raw by column values in a queue.
example :
Table

id    products    category
1          a                xy
2          b                ab
3          c                bc
4          d                cc
5          e                xy
6          f                 xy

I want out put as an
order by : category (cc,ab,bc,xy)

id    products    category
4          d                cc
2          b                ab
3          c                bc
1          a                xy
5          e                xy
6          f                 xy

Most helpful comment

@a-zog it can be implemented, we are open for discussion, but better to discuss in slack channel or create new issue

All 3 comments

I have the same problem.

@jenssegers I see that you closed this issue. Would you tell me more about the support of orderByRaw() please?

I need this function so I can order by "order" and keep null values in the end. Like it's mentioned here: https://laracasts.com/discuss/channels/laravel/how-to-write-eloquent-orderby-to-put-null-columns-to-the-last

Of course, I'm still open if there is an alternative.

Thank you in advance

@a-zog it can be implemented, we are open for discussion, but better to discuss in slack channel or create new issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

naveedyasin picture naveedyasin  路  3Comments

pirmax picture pirmax  路  3Comments

ricardofontanelli picture ricardofontanelli  路  3Comments

HassanIbrahim picture HassanIbrahim  路  3Comments

BlakeGardner picture BlakeGardner  路  3Comments