I am trying to grab 20 of the most recent records from my database, but then order them descending. I am not sure if this is even possible. Here is what i have and what my results have been:
$options = ['limit'=>20, 'sort'=>['creation_date'=>-1]];
$result = $db->find(['_id'=> new \MongoDB\BSON\ObjectID($group_id)], $options);
returns 20 newest records, but in ascending order. I want these records, but reversed
$options = ['limit'=>20, 'sort'=>['creation_date'=>1]];
$result = $db->find(['_id'=> new \MongoDB\BSON\ObjectID($group_id)], $options);
returns 20 records in the correct descending order, but it is the oldest 20 records
I am probably missing something simple here, but any suggestions would be greatly appreciated.