mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-07 21:07:44 +00:00
Merge branch 'main' into mobile-select-bug
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
"optimize": "node ./scripts/optimize-assets.js",
|
"optimize": "node ./scripts/optimize-assets.js",
|
||||||
"optimize:all": "node ./scripts/optimize-all.js"
|
"optimize:all": "node ./scripts/optimize-all.js"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.2.0+sha512.0d27364e0139c6aadeed65ada153135e0ca96c8da42123bd50047f961339dc7a758fc2e944b428f52be570d1bd3372455c1c65fa2e7aa0bfbf931190f9552001",
|
"packageManager": "pnpm@10.4.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@number-flow/svelte": "^0.3.3",
|
"@number-flow/svelte": "^0.3.3",
|
||||||
"@sentry/sveltekit": "^8.51.0",
|
"@sentry/sveltekit": "^8.51.0",
|
||||||
|
|||||||
@@ -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.
|
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`.
|
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" %}
|
{% 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).
|
You can change this through [pagination](/docs/products/databases/pagination).
|
||||||
{% /info %}
|
{% /info %}
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ void main() async {
|
|||||||
try {
|
try {
|
||||||
final documents = await databases.listDocuments(
|
final documents = await databases.listDocuments(
|
||||||
'<DATABASE_ID>',
|
'<DATABASE_ID>',
|
||||||
'[COLLECTION_ID]',
|
'<COLLECTION_ID>',
|
||||||
[
|
[
|
||||||
Query.equal('title', ['Avatar', 'Lord of the Rings']),
|
Query.equal('title', ['Avatar', 'Lord of the Rings']),
|
||||||
Query.greaterThan('year', 1999)
|
Query.greaterThan('year', 1999)
|
||||||
@@ -404,7 +404,7 @@ query {
|
|||||||
databasesListDocuments(
|
databasesListDocuments(
|
||||||
databaseId: "<DATABASE_ID>",
|
databaseId: "<DATABASE_ID>",
|
||||||
collectionId: "<COLLECTION_ID>"
|
collectionId: "<COLLECTION_ID>"
|
||||||
queries: [
|
queries: [
|
||||||
"{\"method\":\"equal\",\"attribute\":\"title\",\"values\":[\"Avatar\",\"Lord of the Rings\"]}",
|
"{\"method\":\"equal\",\"attribute\":\"title\",\"values\":[\"Avatar\",\"Lord of the Rings\"]}",
|
||||||
"{\"method\":\"greaterThan\",\"attribute\":\"year\",\"values\":[1999]}"
|
"{\"method\":\"greaterThan\",\"attribute\":\"year\",\"values\":[1999]}"
|
||||||
]
|
]
|
||||||
@@ -418,3 +418,103 @@ query {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
{% /multicode %}
|
{% /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.
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,6 @@
|
|||||||
{
|
{
|
||||||
title: 'Web app',
|
title: 'Web app',
|
||||||
quickStarts: [
|
quickStarts: [
|
||||||
{
|
|
||||||
title: 'Web',
|
|
||||||
icon: 'icon-js',
|
|
||||||
image: '/images/blog/placeholder.png',
|
|
||||||
href: 'web'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: 'Next.js',
|
title: 'Next.js',
|
||||||
icon: 'icon-nextjs',
|
icon: 'icon-nextjs',
|
||||||
@@ -43,47 +37,47 @@
|
|||||||
image: '/images/blog/placeholder.png',
|
image: '/images/blog/placeholder.png',
|
||||||
href: 'vue'
|
href: 'vue'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: 'Nuxt',
|
|
||||||
icon: 'web-icon-nuxt',
|
|
||||||
image: '/images/blog/placeholder.png',
|
|
||||||
href: 'nuxt'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: 'SvelteKit',
|
title: 'SvelteKit',
|
||||||
icon: 'icon-svelte',
|
icon: 'icon-svelte',
|
||||||
image: '/images/blog/placeholder.png',
|
image: '/images/blog/placeholder.png',
|
||||||
href: 'sveltekit'
|
href: 'sveltekit'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: 'Refine',
|
|
||||||
icon: 'web-icon-refine',
|
|
||||||
image: '/images/blog/placeholder.png',
|
|
||||||
href: 'refine'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: 'Angular',
|
title: 'Angular',
|
||||||
icon: 'icon-angular',
|
icon: 'icon-angular',
|
||||||
image: '/images/blog/placeholder.png',
|
image: '/images/blog/placeholder.png',
|
||||||
href: 'angular'
|
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',
|
title: 'Solid',
|
||||||
icon: 'icon-solidjs',
|
icon: 'icon-solidjs',
|
||||||
image: '/images/blog/placeholder.png',
|
image: '/images/blog/placeholder.png',
|
||||||
href: 'solid'
|
href: 'solid'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Web',
|
||||||
|
icon: 'icon-js',
|
||||||
|
image: '/images/blog/placeholder.png',
|
||||||
|
href: 'web'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Mobile and native',
|
title: 'Mobile and native',
|
||||||
quickStarts: [
|
quickStarts: [
|
||||||
{
|
|
||||||
title: 'React Native',
|
|
||||||
icon: 'icon-react-native',
|
|
||||||
image: '/images/blog/placeholder.png',
|
|
||||||
href: 'react-native'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: 'Flutter',
|
title: 'Flutter',
|
||||||
icon: 'icon-flutter',
|
icon: 'icon-flutter',
|
||||||
@@ -91,16 +85,22 @@
|
|||||||
href: 'flutter'
|
href: 'flutter'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Apple',
|
title: 'React Native',
|
||||||
icon: 'icon-apple',
|
icon: 'icon-react-native',
|
||||||
image: '/images/blog/placeholder.png',
|
image: '/images/blog/placeholder.png',
|
||||||
href: 'apple'
|
href: 'react-native'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Android',
|
title: 'Android',
|
||||||
icon: 'icon-android',
|
icon: 'icon-android',
|
||||||
image: '/images/blog/placeholder.png',
|
image: '/images/blog/placeholder.png',
|
||||||
href: 'android'
|
href: 'android'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Apple',
|
||||||
|
icon: 'icon-apple',
|
||||||
|
image: '/images/blog/placeholder.png',
|
||||||
|
href: 'apple'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -120,10 +120,10 @@
|
|||||||
href: 'python'
|
href: 'python'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Dart',
|
title: '.NET',
|
||||||
icon: 'icon-dart',
|
icon: 'icon-dotnet',
|
||||||
image: '/images/blog/placeholder.png',
|
image: '/images/blog/placeholder.png',
|
||||||
href: 'dart'
|
href: 'dotnet'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'PHP',
|
title: 'PHP',
|
||||||
@@ -131,18 +131,18 @@
|
|||||||
image: '/images/blog/placeholder.png',
|
image: '/images/blog/placeholder.png',
|
||||||
href: 'php'
|
href: 'php'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'Dart',
|
||||||
|
icon: 'icon-dart',
|
||||||
|
image: '/images/blog/placeholder.png',
|
||||||
|
href: 'dart'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Ruby',
|
title: 'Ruby',
|
||||||
icon: 'icon-ruby',
|
icon: 'icon-ruby',
|
||||||
image: '/images/blog/placeholder.png',
|
image: '/images/blog/placeholder.png',
|
||||||
href: 'ruby'
|
href: 'ruby'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '.NET',
|
|
||||||
icon: 'icon-dotnet',
|
|
||||||
image: '/images/blog/placeholder.png',
|
|
||||||
href: 'dotnet'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: 'Deno',
|
title: 'Deno',
|
||||||
icon: 'icon-deno',
|
icon: 'icon-deno',
|
||||||
|
|||||||
@@ -602,7 +602,7 @@
|
|||||||
margin-bottom: f.pxToRem(60);
|
margin-bottom: f.pxToRem(60);
|
||||||
@media #{devices.$break2open} {
|
@media #{devices.$break2open} {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 50px;
|
top: 90px;
|
||||||
height: 500px;
|
height: 500px;
|
||||||
transition: top 0.3s ease;
|
transition: top 0.3s ease;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user