mongodb / laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)
https://www.mongodb.com/docs/drivers/php/laravel-mongodb/
MIT License
7.01k stars 1.43k forks source link

Cannot change ordering of query #2385

Open nicolasvahidzein opened 2 years ago

nicolasvahidzein commented 2 years ago

Hello I cannot change the order in which my results are ordered and this is very important. changes asc to desc and vice versa does not affect the query at all.

        //grab all of the user's orders
        $tempOrderslist = Orders::query()
        ->where('userUID', '=', $user->UID)
        ->orderBy('orderDate', 'asc');//'desc' or 'asc' THIS CHANGES NOTHING
        ->take(40)
        ->get();
nicolasvahidzein commented 2 years ago

orderDate is formatted as follows: 2022-05-13T09:01:44.076+00:00