mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
(refactor): Migrate to new Query methods (containsAny, createdBefore, createdAfter)
This commit is contained in:
@@ -571,7 +571,7 @@ class Databases extends Action
|
||||
Query::equal('databaseInternalId', [$databaseInternalId]),
|
||||
Query::equal('type', [Database::VAR_RELATIONSHIP]),
|
||||
Query::notEqual('collectionInternalId', $collectionInternalId),
|
||||
Query::contains('options', ['"relatedCollection":"'. $collectionId .'"']),
|
||||
Query::containsAny('options', ['"relatedCollection":"'. $collectionId .'"']),
|
||||
],
|
||||
$dbForProject,
|
||||
function ($attribute) use ($dbForProject, $databaseInternalId) {
|
||||
|
||||
@@ -92,7 +92,7 @@ class Delete extends Action
|
||||
$ownersCount = $dbForProject->count(
|
||||
collection: 'memberships',
|
||||
queries: [
|
||||
Query::contains('roles', ['owner']),
|
||||
Query::containsAny('roles', ['owner']),
|
||||
Query::equal('teamInternalId', [$team->getSequence()])
|
||||
],
|
||||
max: 2
|
||||
|
||||
@@ -92,7 +92,7 @@ class Update extends Action
|
||||
$ownersCount = $dbForProject->count(
|
||||
collection: 'memberships',
|
||||
queries: [
|
||||
Query::contains('roles', ['owner']),
|
||||
Query::containsAny('roles', ['owner']),
|
||||
Query::equal('teamInternalId', [$team->getSequence()])
|
||||
],
|
||||
max: 2
|
||||
|
||||
@@ -148,7 +148,7 @@ class Interval extends Action
|
||||
|
||||
$staleExecutions = $dbForProject->find('executions', [
|
||||
Query::equal('status', ['processing']),
|
||||
Query::lessThan('$createdAt', $staleThreshold),
|
||||
Query::createdBefore($staleThreshold),
|
||||
Query::limit(100),
|
||||
]);
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class Functions extends Action
|
||||
while ($sum >= $limit) {
|
||||
$functions = $dbForProject->find('functions', [
|
||||
Query::select(['$id', 'events']), // Skip variables subqueries
|
||||
Query::contains('events', $events),
|
||||
Query::containsAny('events', $events),
|
||||
Query::limit($limit),
|
||||
Query::offset($offset),
|
||||
Query::orderAsc('$sequence'),
|
||||
|
||||
@@ -3939,7 +3939,7 @@ trait DatabasesBase
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'queries' => [
|
||||
Query::greaterThan('$createdAt', '1976-06-12')->toString(),
|
||||
Query::createdAfter('1976-06-12')->toString(),
|
||||
],
|
||||
]);
|
||||
|
||||
@@ -3950,7 +3950,7 @@ trait DatabasesBase
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'queries' => [
|
||||
Query::lessThan('$createdAt', '1976-06-12')->toString(),
|
||||
Query::createdBefore('1976-06-12')->toString(),
|
||||
],
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user