Merge branch 'main' into mobile-select-bug

This commit is contained in:
Darshan
2025-02-21 09:45:38 +05:30
committed by GitHub
4 changed files with 142 additions and 42 deletions

View File

@@ -23,7 +23,7 @@
"optimize": "node ./scripts/optimize-assets.js",
"optimize:all": "node ./scripts/optimize-all.js"
},
"packageManager": "pnpm@10.2.0+sha512.0d27364e0139c6aadeed65ada153135e0ca96c8da42123bd50047f961339dc7a758fc2e944b428f52be570d1bd3372455c1c65fa2e7aa0bfbf931190f9552001",
"packageManager": "pnpm@10.4.1",
"dependencies": {
"@number-flow/svelte": "^0.3.3",
"@sentry/sveltekit": "^8.51.0",

View File

@@ -296,11 +296,11 @@ Appwrite SDKs provide a `Query` class to help you build queries. The `Query` cla
Queries are passed to an endpoint through the `queries` parameter as an array of query strings, which can be generated using the `Query` class.
Each query method is logically separated via `AND` operations. For `OR` operation, pass multiple values into the query method separated by commas.
Each query method is logically separated via `AND` operations. For `OR` operation, pass multiple values into the query method separated by commas.
For example `Query.equal('title', ['Avatar', 'Lord of the Rings'])` will fetch the movies `Avatar` or `Lord of the Rings`.
{% info title="Default pagination behavior" %}
By default, results are limited to the **first 25 items**.
By default, results are limited to the **first 25 items**.
You can change this through [pagination](/docs/products/databases/pagination).
{% /info %}
@@ -337,7 +337,7 @@ void main() async {
try {
final documents = await databases.listDocuments(
'<DATABASE_ID>',
'[COLLECTION_ID]',
'<COLLECTION_ID>',
[
Query.equal('title', ['Avatar', 'Lord of the Rings']),
Query.greaterThan('year', 1999)
@@ -404,7 +404,7 @@ query {
databasesListDocuments(
databaseId: "<DATABASE_ID>",
collectionId: "<COLLECTION_ID>"
queries: [
queries: [
"{\"method\":\"equal\",\"attribute\":\"title\",\"values\":[\"Avatar\",\"Lord of the Rings\"]}",
"{\"method\":\"greaterThan\",\"attribute\":\"year\",\"values\":[1999]}"
]
@@ -418,3 +418,103 @@ query {
}
```
{% /multicode %}
## Complex Queries
You can create complex queries by combining AND and OR operations. For example, to find items that are either books under $20 or magazines under $10.
{% multicode %}
```client-web
const results = await databases.listDocuments(
'<DATABASE_ID>',
'<COLLECTION_ID>',
[
Query.or([
Query.and([
Query.equal('category', ['books']),
Query.lessThan('price', 20)
]),
Query.and([
Query.equal('category', ['magazines']),
Query.lessThan('price', 10)
])
])
]
);
```
```client-flutter
final results = await databases.listDocuments(
'<DATABASE_ID>',
'<COLLECTION_ID>',
[
Query.or([
Query.and([
Query.equal('category', ['books']),
Query.lessThan('price', 20)
]),
Query.and([
Query.equal('category', ['magazines']),
Query.lessThan('price', 10)
])
])
]
);
```
```python
results = databases.list_documents(
database_id='<DATABASE_ID>',
collection_id='<COLLECTION_ID>',
queries=[
Query.or_queries([
Query.and_queries([
Query.equal('category', ['books']),
Query.less_than('price', 20)
]),
Query.and_queries([
Query.equal('category', ['magazines']),
Query.less_than('price', 10)
])
])
]
)
```
```client-apple
let results = try await databases.listDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [
Query.or([
Query.and([
Query.equal("category", value: ["books"]),
Query.lessThan("price", value: 20)
]),
Query.and([
Query.equal("category", value: ["magazines"]),
Query.lessThan("price", value: 10)
])
])
]
)
```
```kotlin
val results = databases.listDocuments(
databaseId = '<DATABASE_ID>',
collectionId = '<COLLECTION_ID>',
queries = listOf(
Query.or(listOf(
Query.and(listOf(
Query.equal("category", ["books"]),
Query.lessThan("price", 20)
)),
Query.and(listOf(
Query.equal("category", ["magazines"]),
Query.lessThan("price", 10)
))
))
)
)
```
{% /multicode %}
This example demonstrates how to combine `OR` and `AND` operations. The query uses `Query.or()` to match either condition: books under $20 OR magazines under $10.
Each condition within the OR is composed of two AND conditions - one for the category and one for the price threshold. The database will return documents that match either of these combined conditions.

View File

@@ -19,12 +19,6 @@
{
title: 'Web app',
quickStarts: [
{
title: 'Web',
icon: 'icon-js',
image: '/images/blog/placeholder.png',
href: 'web'
},
{
title: 'Next.js',
icon: 'icon-nextjs',
@@ -43,47 +37,47 @@
image: '/images/blog/placeholder.png',
href: 'vue'
},
{
title: 'Nuxt',
icon: 'web-icon-nuxt',
image: '/images/blog/placeholder.png',
href: 'nuxt'
},
{
title: 'SvelteKit',
icon: 'icon-svelte',
image: '/images/blog/placeholder.png',
href: 'sveltekit'
},
{
title: 'Refine',
icon: 'web-icon-refine',
image: '/images/blog/placeholder.png',
href: 'refine'
},
{
title: 'Angular',
icon: 'icon-angular',
image: '/images/blog/placeholder.png',
href: 'angular'
},
{
title: 'Nuxt',
icon: 'web-icon-nuxt',
image: '/images/blog/placeholder.png',
href: 'nuxt'
},
{
title: 'Refine',
icon: 'web-icon-refine',
image: '/images/blog/placeholder.png',
href: 'refine'
},
{
title: 'Solid',
icon: 'icon-solidjs',
image: '/images/blog/placeholder.png',
href: 'solid'
},
{
title: 'Web',
icon: 'icon-js',
image: '/images/blog/placeholder.png',
href: 'web'
}
]
},
{
title: 'Mobile and native',
quickStarts: [
{
title: 'React Native',
icon: 'icon-react-native',
image: '/images/blog/placeholder.png',
href: 'react-native'
},
{
title: 'Flutter',
icon: 'icon-flutter',
@@ -91,16 +85,22 @@
href: 'flutter'
},
{
title: 'Apple',
icon: 'icon-apple',
title: 'React Native',
icon: 'icon-react-native',
image: '/images/blog/placeholder.png',
href: 'apple'
href: 'react-native'
},
{
title: 'Android',
icon: 'icon-android',
image: '/images/blog/placeholder.png',
href: 'android'
},
{
title: 'Apple',
icon: 'icon-apple',
image: '/images/blog/placeholder.png',
href: 'apple'
}
]
},
@@ -120,10 +120,10 @@
href: 'python'
},
{
title: 'Dart',
icon: 'icon-dart',
title: '.NET',
icon: 'icon-dotnet',
image: '/images/blog/placeholder.png',
href: 'dart'
href: 'dotnet'
},
{
title: 'PHP',
@@ -131,18 +131,18 @@
image: '/images/blog/placeholder.png',
href: 'php'
},
{
title: 'Dart',
icon: 'icon-dart',
image: '/images/blog/placeholder.png',
href: 'dart'
},
{
title: 'Ruby',
icon: 'icon-ruby',
image: '/images/blog/placeholder.png',
href: 'ruby'
},
{
title: '.NET',
icon: 'icon-dotnet',
image: '/images/blog/placeholder.png',
href: 'dotnet'
},
{
title: 'Deno',
icon: 'icon-deno',

View File

@@ -602,7 +602,7 @@
margin-bottom: f.pxToRem(60);
@media #{devices.$break2open} {
position: sticky;
top: 50px;
top: 90px;
height: 500px;
transition: top 0.3s ease;