View Source Appwrite.Utils.Query (appwrite v0.1.9)
A helper module to generate query strings for Appwrite filters.
This module provides functions to construct queries for filtering, sorting, and limiting resources in an Appwrite database.
Each function returns a JSON string representation of the query.
Summary
Functions
Filter resources where attribute is between the start and end values (inclusive).
Filter resources where attribute contains the specified value(s).
Return results after the specified document ID.
Return results before the specified document ID.
Filter resources where attribute ends with the value.
Filter resources where attribute is equal to the value.
Filter resources where attribute is greater than the value.
Filter resources where attribute is greater than or equal to the value.
Filter resources where attribute is not null.
Filter resources where attribute is null.
Filter resources where attribute is less than the value.
Filter resources where attribute is less than or equal to the value.
Limit the number of results returned.
Combine multiple queries using logical AND.
Combine multiple queries using logical OR.
Create a query with the given method, attribute, and values.
Filter resources where attribute is not equal to the value.
Skip the first offset
number of results.
Sort results by attribute ascending.
Sort results by attribute descending.
Filter resources by searching an attribute for a value.
Specify which attributes should be returned by the API call.
Filter resources where attribute starts with the value.
Types
Functions
@spec between(String.t(), query_types_single(), query_types_single()) :: String.t()
Filter resources where attribute is between the start and end values (inclusive).
Filter resources where attribute contains the specified value(s).
Return results after the specified document ID.
Return results before the specified document ID.
Filter resources where attribute ends with the value.
@spec equal(String.t(), query_types()) :: String.t()
Filter resources where attribute is equal to the value.
@spec greater_than(String.t(), query_types()) :: String.t()
Filter resources where attribute is greater than the value.
@spec greater_than_equal(String.t(), query_types()) :: String.t()
Filter resources where attribute is greater than or equal to the value.
Filter resources where attribute is not null.
Filter resources where attribute is null.
@spec less_than(String.t(), query_types()) :: String.t()
Filter resources where attribute is less than the value.
@spec less_than_equal(String.t(), query_types()) :: String.t()
Filter resources where attribute is less than or equal to the value.
@spec limit(non_neg_integer()) :: String.t()
Limit the number of results returned.
Combine multiple queries using logical AND.
Combine multiple queries using logical OR.
@spec new(String.t(), attributes_types() | nil, query_types() | nil) :: String.t()
Create a query with the given method, attribute, and values.
Examples
iex> Appwrite.Query.new("equal", "name", "John")
"{"method":"equal","attribute":"name","values":["John"]}"
@spec not_equal(String.t(), query_types()) :: String.t()
Filter resources where attribute is not equal to the value.
@spec offset(non_neg_integer()) :: String.t()
Skip the first offset
number of results.
Sort results by attribute ascending.
Sort results by attribute descending.
Filter resources by searching an attribute for a value.
Specify which attributes should be returned by the API call.
Filter resources where attribute starts with the value.