We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 715e55d commit 3fca9dfCopy full SHA for 3fca9df
src/db/Mongo.php
@@ -486,7 +486,9 @@ public function limit(int $offset, ?int $length = null)
486
public function order($field, string $order = '')
487
{
488
if (is_array($field)) {
489
- $this->options['sort'] = $field;
+ $this->options['sort'] = array_map(function ($val) {
490
+ return 'asc' == strtolower($val) ? 1 : -1;
491
+ }, $field);
492
} else {
493
$this->options['sort'][$field] = 'asc' == strtolower($order) ? 1 : -1;
494
}
0 commit comments