From 9ddc42eab2bfa91f8347df44cf5ac91e9364a08b Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Thu, 1 Jun 2023 17:33:54 +0000 Subject: [PATCH 1/3] Add syntax for everything --- app/views/docs/queries.phtml | 1419 +++++++++++++++++++++++++++++++--- 1 file changed, 1313 insertions(+), 106 deletions(-) diff --git a/app/views/docs/queries.phtml b/app/views/docs/queries.phtml index 205edff29..9776224cd 100644 --- a/app/views/docs/queries.phtml +++ b/app/views/docs/queries.phtml @@ -5,114 +5,1321 @@

Query Class

Appwrite SDKs provide a Query class to help you build queries. The Query class has a method for each type of supported query.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Query MethodSDK Method ExampleDescription
SelectQuery.select(["name", "title"])Select which attributes should be returned from a document.
EqualQuery.equal("title", ["Iron Man"])Returns document if attribute is equal to any value in the provided array.
Not EqualQuery.notEqual("title", ["Iron Man"])Returns document if attribute is not equal to any value in the provided array.
Less ThanQuery.lessThan("score", 10)Returns document if attribute is less than the provided value.
Less Than or EqualQuery.lessThanEqual("score", 10)Returns document if attribute is less than or equal to the provided value.
Greater ThanQuery.greaterThan("score", 10)Returns document if attribute is greater than the provided value.
Greater Than or EqualQuery.greaterThanEqual("score", 10)Returns document if attribute is greater than or equal to the provided value.
BetweenQuery.between("price", 5, 10)Returns document if attribute value falls between the two values. The boundary values are inclusive and can be strings or numbers.
Is NullQuery.isNull("name")Returns documents where attribute value is null.
Is Not NullQuery.isNotNull("name")Returns documents where attribute value is not null.
Starts WithQuery.startsWith("name", "Once upon a time")Returns documents if a string attributes starts with a substring.
Ends WithQuery.endsWith("name", "happily ever after.")Returns documents if a string attributes ends with a substring.
SearchQuery.search("text", "key words")Searches string attributes for provided keywords. Requires a Full-text index on queried attributes.
Order DescendingQuery.orderDesc("attribute")Orders results in descending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order.
Order AscendingQuery.orderAsc("attribute")Orders results in ascending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order.
LimitQuery.limit(25)Limits the number of results returned by the query. Used for pagination. If the limit query is not used, the limit defaults to 25 results.
OffsetQuery.offset(0)Offset the results returned by skipping some of the results. Used for pagination.
Cursor AfterQuery.cursorAfter("62a7...f620")Places the cursor after the specified resource ID. Used for pagination.
Cursor BeforeQuery.cursorBefore("62a7...a600")Places the cursor before the specified resource ID. Used for pagination.
+

Client SDKs

+ +

Server SDKs

+

Building Queries

Queries are passed to an endpoint through the queries parameter as an array of query strings, which can be generated using the Query class. From b32fba76cb0dd63241d540bbf5b6025f9242365a Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Mon, 5 Jun 2023 18:39:23 +0000 Subject: [PATCH 2/3] Use h4 to not break tabs --- app/views/docs/queries.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/docs/queries.phtml b/app/views/docs/queries.phtml index 9776224cd..c90970693 100644 --- a/app/views/docs/queries.phtml +++ b/app/views/docs/queries.phtml @@ -6,7 +6,7 @@

Query Class

Appwrite SDKs provide a Query class to help you build queries. The Query class has a method for each type of supported query.

-

Client SDKs

+

Client SDKs

-

Server SDKs

+

Server SDKs