diff --git a/app/views/docs/databases.phtml b/app/views/docs/databases.phtml index 26fa7f733..2d014d22c 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.
string
integer
float
boolean
enum
ip
email
url
- 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. @@ -231,10 +230,10 @@ func main() async throws {
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:
Query Method | +Query Method | SDK Method Example | Description | |
---|---|---|---|---|
equal | -Query.equal("title", ["Iron Man"]) | +Equal | +Query.equal("title", ["Iron Man"]) |
Returns document if attribute is equal to any value in the provided array. Applies to any indexed attribute. |
notEqual | -Query.notEqual("title", ["Iron Man"]) | +Not Equal | +Query.notEqual("title", ["Iron Man"]) |
Returns document if attribute is not equal to any value in the provided array. Applies to any indexed attribute. |
lessThan | -Query.lessThan("score", 10) | +Less Than | +Query.lessThan("score", 10) |
Returns document if attribute is less than the provided value. Applies to any indexed attribute. |
lessThanEqual | -Query.lessThanEqual("score", 10) | +Less 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. |
greaterThan | -Query.greaterThan("score", 10) | +Greater Than | +Query.greaterThan("score", 10) |
Returns document if attribute is greater than the provided value. Applies to any indexed attribute. |
greaterThanEqual | -Query.greaterThanEqual("score", 10) | +Greater 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. |
search | -Query.search("text", "key words") | +Search | +Query.search("text", "key words") |
Searches string attributes for provided keywords. Applies to any string attribute with a full-text index. |
orderDesc | -Query.orderDesc("attribute") | +Order Descending | +Query.orderDesc("attribute") |
Orders results in descending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. |
orderAsc | -Query.orderAsc("attribute") | +Order Ascending | +Query.orderAsc("attribute") |
Orders results in ascending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. |
limit | -Query.limit(25) | +Limit | +Query.limit(25) |
Limits the number of results returned by the query. Used for pagination. |
offset | -Query.offset(0) | +Offset | +Query.offset(0) |
Offset the results returned by skipping some of the results. Used for pagination. |
cursorAfter | -Query.cursorAfter("62a7...f620") | +Cursor After | +Query.cursorAfter("62a7...f620") |
Places the cursor after the specified resource ID. Used for pagination. |
cursorBefore | -Query.cursorBefore("62a7...a600") | +Cursor Before | +Query.cursorBefore("62a7...a600") |
Places the cursor before the specified resource ID. Used for pagination. |
Each query string is logically separated via AND. For OR logic, pass multiple values, separated by commas:
+Each query string is logically separated via AND
operation. For OR
operation, pass multiple values separated by commas:
When performing a query against multiple attributes, a single index with all query attributes is required. In the example above, a single index with both title and year is required.
+When performing a query against multiple attributes, a single index with all query attributes is required. In the example above, a single index with both title
and year
is required.
- Indexes are used by Databases to quickly locate data without having to search through every document for results. + Databases use indexes to quickly locate data without having to search through every document for matches. To ensure the best performance, Appwrite requires an index for every query. - You can create an index by navigating to the Indexes tab of your collection or by using your favorite Server SDK. If you plan to query multiple attributes in a single query, you will need an index with all queried attributes. + You can create an index by navigating to your collection's Indexes tab or by using your favorite Server SDK. If you plan to query multiple attributes in a single query, you will need an index with all queried attributes.
-It should be noted that Appwrite's database was designed to protect your queries from performing a full-table scan as this is a footgun and could cause catastrophic performance degradation as you scale up your Appwrite project.
+It should be noted that Appwrite's Databases Service is designed to protect your queries from performing a full-table scan, as this could cause catastrophic performance degradation as you scale up your Appwrite project.
The following indexes are currently supported:
@@ -592,7 +591,7 @@ func main() async throws {key
fulltext
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.