Skip to content

Commit f97a9b2

Browse files
committed
Fix Mongo
1 parent 16f2ffc commit f97a9b2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/Database/Adapter/Mongo.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,9 +1104,7 @@ public function find(string $collection, array $queries = [], ?int $limit = 25,
11041104
// orders
11051105
$hasIdAttribute = false;
11061106
foreach ($orderAttributes as $i => $attribute) {
1107-
if (\in_array($attribute, ['_uid', '_id'])) {
1108-
$hasIdAttribute = true;
1109-
}
1107+
var_dump($attribute);
11101108

11111109
$attribute = $this->filter($attribute);
11121110
$orderType = $this->filter($orderTypes[$i] ?? Database::ORDER_ASC);
@@ -1120,6 +1118,10 @@ public function find(string $collection, array $queries = [], ?int $limit = 25,
11201118
$attribute = $attribute == 'createdAt' ? '_createdAt' : $attribute;
11211119
$attribute = $attribute == 'updatedAt' ? '_updatedAt' : $attribute;
11221120

1121+
if (\in_array($attribute, ['_uid', '_id'])) {
1122+
$hasIdAttribute = true;
1123+
}
1124+
11231125
$options['sort'][$attribute] = $this->getOrder($orderType);
11241126
}
11251127

0 commit comments

Comments
 (0)