Skip to content

Commit 64c4669

Browse files
committed
Merge pull request #626 from deadem/master
allow to sort by $meta-projection
2 parents 7e09ee8 + 0446c47 commit 64c4669

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Jenssegers/Mongodb/Query/Builder.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,10 @@ public function distinct($column = false)
385385
*/
386386
public function orderBy($column, $direction = 'asc')
387387
{
388-
$direction = (strtolower($direction) == 'asc' ? 1 : -1);
388+
if (is_string($direction))
389+
{
390+
$direction = (strtolower($direction) == 'asc' ? 1 : -1);
391+
}
389392

390393
if ($column == 'natural')
391394
{

0 commit comments

Comments
 (0)