diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php index 97588630d5..c35eebaea2 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/XList.php @@ -170,7 +170,7 @@ class XList extends Action if ($cachedTotal !== null && $cachedTotal !== false) { $total = $cachedTotal; } else { - $total = $dbForProject->count($collectionTableId, $queries, APP_LIMIT_COUNT); + $total = $dbForDatabases->count($collectionTableId, $queries, APP_LIMIT_COUNT); $dbForProject->getCache()->save($cacheKey, $total, $totalField); } } else {