diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Collection.php b/src/Appwrite/Utopia/Database/Validator/Queries/Collection.php new file mode 100644 index 0000000000..dffaabee6d --- /dev/null +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Collection.php @@ -0,0 +1,58 @@ + $key, + 'type' => $attribute['type'], + 'array' => $attribute['array'], + ]); + } + + $indexes = []; + foreach ($allowedAttributes as $attribute) { + $indexes[] = new Document([ + 'status' => 'available', + 'type' => Database::INDEX_KEY, + 'attributes' => [$attribute] + ]); + } + $indexes[] = new Document([ + 'status' => 'available', + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'] + ]); + + parent::__construct(new QueryValidator($attributes), $attributes, $indexes, true); + } +} \ No newline at end of file diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Users.php b/src/Appwrite/Utopia/Database/Validator/Queries/Users.php new file mode 100644 index 0000000000..b61ec9c086 --- /dev/null +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Users.php @@ -0,0 +1,31 @@ +