From 931611b69d8ecb26fcc5c1f20a4f78dc96fdfc5e Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 4 Oct 2022 20:23:59 +0000 Subject: [PATCH 1/2] Update Database guide to conform to guidelines proposed in PR #229. --- app/views/docs/databases.phtml | 103 ++++++++++++++++----------------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/app/views/docs/databases.phtml b/app/views/docs/databases.phtml index a5f4e9951..9019aae08 100644 --- a/app/views/docs/databases.phtml +++ b/app/views/docs/databases.phtml @@ -1,8 +1,7 @@

The Databases Service allows you to store your application and users' data and fetch it using different supported queries. - Using your Appwrite Databases, you can create multiple databases, organize your data into collections and documents using the Appwrite REST API. You can also use the Appwrite Realtime API to subscribe to live changes in your collections and documents. - In addition, the Databases Service provides built-in validation to check the integrity of your incoming data, custom indexing for query performance, - as well as a flexible permissions mechanism to allow you to easily segment data between different users, teams, and roles. + Using the Databases Service, you can create multiple databases and organize your data into collections and documents using Appwrite's REST API. You can also use the Appwrite Realtime API to subscribe to live changes in your collections and documents. + In addition, the Databases Service provides built-in validation to check the integrity of your incoming data, custom indexing for query performance, and a flexible permissions mechanism to easily segment data between different users, teams, and roles.

Create Your Databases

@@ -33,7 +32,7 @@

Permissions

- Appwrite provides permissions to restrict access to documents at two levels, document and collection level. When a user has the appropriate type of access permissions granted at either the document or the collection level, they will be able to access or change the document. If the permission field is left empty, Client SDKs cannot access the document. + Appwrite provides permissions to restrict access to documents at two levels, document and collection level. When a user has the appropriate permission type granted at either the document or the collection level, they will be able to access or change the document. If the permission field is left empty, Client SDKs cannot access the document.

Document Level Permissions

@@ -55,46 +54,46 @@ - string + string String attribute. - integer + integer Integer attribute. - float + float Float attribute. - boolean + boolean Boolean attribute. - enum + enum Enum attribute. - ip + ip IP address attribute for IPv4 and IPv6. - email + email Email address attribute. - url + url URL attribute.

- If an attribute must be present in all documents, set it as required. If not, a default value might be handy. Additionally, decide if the attribute should be a primitive or array of values. + If an attribute must be populated in all documents, set it as required. If not, a default value might be handy, but is not required. Additionally, decide if the attribute should be a primitive or an array of values.

- When adding or removing attributes, your requests are processed in the background, indicated by the attribute's status. - Depending on your collection's size and other factors, this could take anywhere from a few seconds to a few minutes to complete. You are able to create a document while your attributes are still being processed, however you are not able to use the attributes on the documents until they are available + When adding or removing attributes, your requests are processed in the background, indicated by the attribute's status. + Depending on your collection's size and other factors, this could take anywhere from a few seconds to a few minutes to complete. You are able to create a document while your attributes are still being processed, but you are not able to use the attributes on the documents until their status becomes available.

Create Documents

@@ -211,10 +210,10 @@ func main() async throws {

Indexes Required

-

You can only query indexed attributes. You can easily add new indexes from both the Appwrite console or any of the server SDKs. Appwrite uses this limitation to enforce optimized queries for maximum performance and scalability of your collection. You can learn more about it in the Appwrite Indexes section.

+

You can only query indexed attributes. You can easily add new indexes from both your project's dashboard or any of the server SDKs. Appwrite uses this limitation to enforce optimized queries for maximum performance and scalability of your collection. You can learn more about it in the Appwrite Indexes section.

- To find specific documents in a collection, pass an array of query strings as a parameter to the listDocuments endpoint. The SDKs provide a Query class to make query building simpler: + To find specific documents in a collection, pass an array of query strings as a parameter to the List Documents endpoint. The SDKs provide a Query class to make query building simpler:

-

In the example above, the movies returned will be first sorted by title in ascending order, then sorted by year in descending order.

+

In the example above, the movies returned will be first sorted by title in ascending order, then sorted by year in descending order.

Appwrite has full support for pagination to better optimize and scale up your applications built on Appwrite. Detailed documentation on pagination and how to implement it can be found on the pagination guide.

From 1a4bb25b6151d3bd4aec4a98b1048b003607316a Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 4 Oct 2022 20:43:13 +0000 Subject: [PATCH 2/2] Change column width to remove eye sores --- app/views/docs/databases.phtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/docs/databases.phtml b/app/views/docs/databases.phtml index 9019aae08..75d4c58d9 100644 --- a/app/views/docs/databases.phtml +++ b/app/views/docs/databases.phtml @@ -331,7 +331,7 @@ func main() async throws{ - + @@ -353,7 +353,7 @@ func main() async throws{ - + @@ -363,7 +363,7 @@ func main() async throws{ - +
Query MethodQuery Method SDK Method Example Description
Returns document if attribute is less than the provided value. Applies to any indexed attribute.
Less Than or Equal ToLess Than or Equal Query.lessThanEqual("score", 10) Returns document if attribute is less than or equal to the provided value. Applies to any indexed attribute.
Returns document if attribute is greater than the provided value. Applies to any indexed attribute.
Greater Than or Equal ToGreater Than or Equal Query.greaterThanEqual("score", 10) Returns document if attribute is greater than or equal to the provided value. Applies to any indexed attribute.