diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 971faf82c6..06d5030fd3 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -2872,7 +2872,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->inject('user') ->inject('queueForEvents') ->inject('queueForUsage') - ->inject('queueForRealtime') ->inject('project') ->inject('mode') ->action(function (string $databaseId, ?string $documentId, string $collectionId, string|array|null $data, ?array $documents, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, Usage $queueForUsage, Realtime $queueForRealtime, Document $project, string $mode) { diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 3ef96298c6..5f5db46a70 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -95,9 +95,9 @@ $usageDatabaseListener = function (string $event, Document $document, Usage $que } if ($event === Database::EVENT_DOCUMENTS_DELETE) { - $value = -1 * count($document->getAttribute('modified', [])); + $value = -1 * $document->getAttribute('modified', 0); } elseif ($event === Database::EVENT_DOCUMENTS_CREATE) { - $value = count($document->getAttribute('modified', [])); + $value = $document->getAttribute('modified', 0); } switch (true) { diff --git a/composer.json b/composer.json index ff0e44550d..0cd20fc577 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.26", + "utopia-php/database": "0.53.27", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", diff --git a/composer.lock b/composer.lock index 62dac10ab6..be7dd88f82 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fad37c607bf3a162dff5d0ee76d56984", + "content-hash": "0b299e8aaf279f410c6d81c1ad3a5031", "packages": [ { "name": "adhocore/jwt", @@ -3476,16 +3476,16 @@ }, { "name": "utopia-php/database", - "version": "0.53.26", + "version": "0.53.27", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "a351af62518b830044862c901fd06910046343b7" + "reference": "d3a8cae6e743a6a1a5719b860762a03aabce678a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/a351af62518b830044862c901fd06910046343b7", - "reference": "a351af62518b830044862c901fd06910046343b7", + "url": "https://api.github.com/repos/utopia-php/database/zipball/d3a8cae6e743a6a1a5719b860762a03aabce678a", + "reference": "d3a8cae6e743a6a1a5719b860762a03aabce678a", "shasum": "" }, "require": { @@ -3526,9 +3526,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.26" + "source": "https://github.com/utopia-php/database/tree/0.53.27" }, - "time": "2024-12-02T07:36:52+00:00" + "time": "2024-12-02T08:53:55+00:00" }, { "name": "utopia-php/domains",