diff --git a/app/views/docs/queries.phtml b/app/views/docs/queries.phtml index 205edff29..627beea86 100644 --- a/app/views/docs/queries.phtml +++ b/app/views/docs/queries.phtml @@ -5,114 +5,1322 @@
Appwrite SDKs provide a Query
class to help you build queries. The Query
class has a method for each type of supported query.
Query Method | -SDK Method Example | -Description | -
---|---|---|
Select | -Query.select(["name", "title"]) |
- Select which attributes should be returned from a document. | -
Equal | -Query.equal("title", ["Iron Man"]) |
- Returns document if attribute is equal to any value in the provided array. | -
Not Equal | -Query.notEqual("title", ["Iron Man"]) |
- Returns document if attribute is not equal to any value in the provided array. | -
Less Than | -Query.lessThan("score", 10) |
- Returns document if attribute is less than the provided value. | -
Less Than or Equal | -Query.lessThanEqual("score", 10) |
- Returns document if attribute is less than or equal to the provided value. | -
Greater Than | -Query.greaterThan("score", 10) |
- Returns document if attribute is greater than the provided value. | -
Greater Than or Equal | -Query.greaterThanEqual("score", 10) |
- Returns document if attribute is greater than or equal to the provided value. | -
Between | -Query.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 Null | -Query.isNull("name") |
- Returns documents where attribute value is null. | -
Is Not Null | -Query.isNotNull("name") |
- Returns documents where attribute value is not null. | -
Starts With | -Query.startsWith("name", "Once upon a time") |
- Returns documents if a string attributes starts with a substring. | -
Ends With | -Query.endsWith("name", "happily ever after.") |
- Returns documents if a string attributes ends with a substring. | -
Search | -Query.search("text", "key words") |
- Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | -
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. | -
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) |
- 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. | -
Offset | -Query.offset(0) |
- Offset the results returned by skipping some of the results. Used for pagination. | -
Cursor After | -Query.cursorAfter("62a7...f620") |
- Places the cursor after the specified resource ID. Used for pagination. | -
Cursor Before | -Query.cursorBefore("62a7...a600") |
- Places the cursor before the specified resource ID. Used for pagination. | -
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.notEqual("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.lessThan("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.lessThanEqual("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greaterThan("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greaterThanEqual("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.isNull("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.isNotNull("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.startsWith("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.endsWith("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
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. | +
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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursorAfter("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursorBefore("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.notEqual("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.lessThan("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.lessThanEqual("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greaterThan("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greaterThanEqual("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.isNull("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.isNotNull("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.startsWith("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.endsWith("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
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. | +
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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursorAfter("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursorBefore("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.notEqual("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.lessThan("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.lessThanEqual("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greaterThan("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greaterThanEqual("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.isNull("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.isNotNull("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.startsWith("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.endsWith("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
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. | +
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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursorAfter("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursorBefore("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.notEqual("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.lessThan("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.lessThanEqual("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greaterThan("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greaterThanEqual("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.isNull("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.isNotNull("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.startsWith("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.endsWith("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
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. | +
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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursorAfter("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursorBefore("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.notEqual("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.lessThan("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.lessThanEqual("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greaterThan("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greaterThanEqual("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.isNull("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.isNotNull("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.startsWith("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.endsWith("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
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. | +
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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursorAfter("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursorBefore("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query::select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query::equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query::notEqual("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query::lessThan("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query::lessThanEqual("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query::greaterThan("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query::greaterThanEqual("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query::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 Null | +Query::isNull("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query::isNotNull("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query::startsWith("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query::endsWith("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query::search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
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. | +
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) |
+ 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. | +
Offset | +Query::offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query::cursorAfter("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query::cursorBefore("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.not_equal("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.less_than("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.less_than_equal("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greater_than("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greater_than_equal("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.is_null("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.is_not_null("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.starts_with("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.ends_with("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
Order Descending | +Query.order_desc("attribute") |
+ Orders results in descending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. | +
Order Ascending | +Query.order_asc("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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursor_after("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursor_before("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.not_equal("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.less_than("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.less_than_equal("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greater_than("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greater_than_equal("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.is_null("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.is_not_null("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.starts_with("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.ends_with("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
Order Descending | +Query.order_desc("attribute") |
+ Orders results in descending order by attribute. Attribute must be indexed. Pass in an empty string to return in natural order. | +
Order Ascending | +Query.order_asc("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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursor_after("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursor_before("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.notEqual("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.lessThan("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.lessThanEqual("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greaterThan("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greaterThanEqual("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.isNull("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.isNotNull("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.startsWith("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.endsWith("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
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. | +
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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursorAfter("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursorBefore("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.notEqual("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.lessThan("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.lessThanEqual("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greaterThan("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greaterThanEqual("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.isNull("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.isNotNull("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.startsWith("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.endsWith("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
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. | +
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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursorAfter("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursorBefore("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.notEqual("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.lessThan("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.lessThanEqual("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greaterThan("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greaterThanEqual("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.isNull("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.isNotNull("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.startsWith("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.endsWith("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
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. | +
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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursorAfter("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursorBefore("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Query Method | +SDK Method Example | +Description | +
---|---|---|
Select | +Query.select(["name", "title"]) |
+ Select which attributes should be returned from a document. | +
Equal | +Query.equal("title", ["Iron Man"]) |
+ Returns document if attribute is equal to any value in the provided array. | +
Not Equal | +Query.notEqual("title", ["Iron Man"]) |
+ Returns document if attribute is not equal to any value in the provided array. | +
Less Than | +Query.lessThan("score", 10) |
+ Returns document if attribute is less than the provided value. | +
Less Than or Equal | +Query.lessThanEqual("score", 10) |
+ Returns document if attribute is less than or equal to the provided value. | +
Greater Than | +Query.greaterThan("score", 10) |
+ Returns document if attribute is greater than the provided value. | +
Greater Than or Equal | +Query.greaterThanEqual("score", 10) |
+ Returns document if attribute is greater than or equal to the provided value. | +
Between | +Query.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 Null | +Query.isNull("name") |
+ Returns documents where attribute value is null. | +
Is Not Null | +Query.isNotNull("name") |
+ Returns documents where attribute value is not null. | +
Starts With | +Query.startsWith("name", "Once upon a time") |
+ Returns documents if a string attributes starts with a substring. | +
Ends With | +Query.endsWith("name", "happily ever after.") |
+ Returns documents if a string attributes ends with a substring. | +
Search | +Query.search("text", "key words") |
+ Searches string attributes for provided keywords. Requires a Full-text index on queried attributes. | +
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. | +
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) |
+ 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. | +
Offset | +Query.offset(0) |
+ Offset the results returned by skipping some of the results. Used for pagination. | +
Cursor After | +Query.cursorAfter("62a7...f620") |
+ Places the cursor after the specified resource ID. Used for pagination. | +
Cursor Before | +Query.cursorBefore("62a7...a600") |
+ Places the cursor before the specified resource ID. Used for pagination. | +
Queries are passed to an endpoint through the queries
parameter as an array of query strings, which can be generated using the Query
class.