From 79c8ed3ce44e47f925621925077375b2e1db86ed Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 25 Mar 2023 17:11:19 +1300 Subject: [PATCH] Remove $collection and $internalId for nested documents --- src/Appwrite/Utopia/Response/Model/Document.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Appwrite/Utopia/Response/Model/Document.php b/src/Appwrite/Utopia/Response/Model/Document.php index e1d393587c..ea21c89668 100644 --- a/src/Appwrite/Utopia/Response/Model/Document.php +++ b/src/Appwrite/Utopia/Response/Model/Document.php @@ -74,6 +74,12 @@ class Document extends Any $document->removeAttribute('$internalId'); $document->removeAttribute('$collection'); // $collection is the internal collection ID + foreach ($document->getAttributes() as $attribute) { + if ($attribute instanceof DatabaseDocument) { + $this->filter($attribute); + } + } + return $document; } }