Skip to content

Commit 5a98f7d

Browse files
committed
update: remove wildcards.
1 parent 25e3dc8 commit 5a98f7d

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

src/Database/Database.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3078,12 +3078,7 @@ public function getDocument(string $collection, string $id, array $queries = [],
30783078
$document = $this->decode($collection, $document, $selections);
30793079
$this->map = [];
30803080

3081-
$hasWildcards = !empty(array_filter(
3082-
$selects,
3083-
fn ($select) => in_array('*', $select->getValues(), true)
3084-
));
3085-
3086-
if ($this->resolveRelationships && (empty($selects) || $hasWildcards || !empty($nestedSelections))) {
3081+
if ($this->resolveRelationships && (empty($selects) || !empty($nestedSelections))) {
30873082
$document = $this->silent(fn () => $this->populateDocumentRelationships($collection, $document, $nestedSelections));
30883083
}
30893084

@@ -5782,13 +5777,9 @@ public function find(string $collection, array $queries = [], string $forPermiss
57825777
);
57835778

57845779
$results = $skipAuth ? Authorization::skip($getResults) : $getResults();
5785-
$hasWildcards = !empty(array_filter(
5786-
$selects,
5787-
fn ($select) => in_array('*', $select->getValues(), true)
5788-
));
57895780

57905781
foreach ($results as &$node) {
5791-
if ($this->resolveRelationships && (empty($selects) || $hasWildcards || !empty($nestedSelections))) {
5782+
if ($this->resolveRelationships && (empty($selects) || !empty($nestedSelections))) {
57925783
$node = $this->silent(fn () => $this->populateDocumentRelationships($collection, $node, $nestedSelections));
57935784
}
57945785
$node = $this->casting($collection, $node);

0 commit comments

Comments
 (0)