Skip to content

Commit 60acf75

Browse files
committed
Fix Mongo revert
1 parent f97a9b2 commit 60acf75

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/Database/Adapter/Mongo.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,10 +1102,7 @@ public function find(string $collection, array $queries = [], ?int $limit = 25,
11021102
}
11031103

11041104
// orders
1105-
$hasIdAttribute = false;
11061105
foreach ($orderAttributes as $i => $attribute) {
1107-
var_dump($attribute);
1108-
11091106
$attribute = $this->filter($attribute);
11101107
$orderType = $this->filter($orderTypes[$i] ?? Database::ORDER_ASC);
11111108

@@ -1118,16 +1115,10 @@ public function find(string $collection, array $queries = [], ?int $limit = 25,
11181115
$attribute = $attribute == 'createdAt' ? '_createdAt' : $attribute;
11191116
$attribute = $attribute == 'updatedAt' ? '_updatedAt' : $attribute;
11201117

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

1128-
if (!$hasIdAttribute) {
1129-
$options['sort']['_id'] = $this->getOrder($cursorDirection === Database::CURSOR_AFTER ? Database::ORDER_ASC : Database::ORDER_DESC);
1130-
}
1121+
$options['sort']['_id'] = $this->getOrder($cursorDirection === Database::CURSOR_AFTER ? Database::ORDER_ASC : Database::ORDER_DESC);
11311122

11321123
// queries
11331124

0 commit comments

Comments
 (0)