Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update: remove wildcards.
  • Loading branch information
ItzNotABug committed May 2, 2025
commit 5a98f7d7f7bb2dc15658abb93fac09c5c06ec5ac
13 changes: 2 additions & 11 deletions src/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -3078,12 +3078,7 @@ public function getDocument(string $collection, string $id, array $queries = [],
$document = $this->decode($collection, $document, $selections);
$this->map = [];

$hasWildcards = !empty(array_filter(
$selects,
fn ($select) => in_array('*', $select->getValues(), true)
));

if ($this->resolveRelationships && (empty($selects) || $hasWildcards || !empty($nestedSelections))) {
if ($this->resolveRelationships && (empty($selects) || !empty($nestedSelections))) {
$document = $this->silent(fn () => $this->populateDocumentRelationships($collection, $document, $nestedSelections));
}

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

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

foreach ($results as &$node) {
if ($this->resolveRelationships && (empty($selects) || $hasWildcards || !empty($nestedSelections))) {
if ($this->resolveRelationships && (empty($selects) || !empty($nestedSelections))) {
$node = $this->silent(fn () => $this->populateDocumentRelationships($collection, $node, $nestedSelections));
}
$node = $this->casting($collection, $node);
Expand Down
Loading