diff --git a/MongoDataConnection.php b/MongoDataConnection.php index b12bc2c..b6d082f 100644 --- a/MongoDataConnection.php +++ b/MongoDataConnection.php @@ -153,6 +153,9 @@ function query($table, $query) { if (!empty($query['limit'])) { $return = $return->limit($query['limit']); } + if (!empty($query['sort'])) { + $return = $return->sort($query['sort']); + } $mongodata = array(); while ($return->hasNext()) {