vybekiit 0.7.26 → 0.7.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +3891 -1301
- package/dist/global-skills/aws-cdk/SKILL.md +19 -5
- package/dist/global-skills/aws-cdk/references/fast-deployments.md +191 -0
- package/dist/global-skills/aws-cdk/references/troubleshooting-deployment.md +16 -0
- package/dist/global-skills/aws-cloudformation/SKILL.md +16 -26
- package/dist/global-skills/aws-cloudformation/references/check-cloudformation-template-compliance.script.md +7 -3
- package/dist/global-skills/aws-cloudformation/references/cloudformation-language-server.md +177 -0
- package/dist/global-skills/aws-cloudformation/references/cloudformation-pre-deploy-validation.script.md +8 -2
- package/dist/global-skills/aws-cloudformation/references/persist-template-context.script.md +5 -8
- package/dist/global-skills/aws-cloudformation/references/retrieve-template-context.script.md +1 -1
- package/dist/global-skills/aws-cloudformation/references/security-considerations.md +51 -0
- package/dist/global-skills/aws-cloudformation/references/troubleshoot-failed-stack.script.md +138 -0
- package/dist/global-skills/aws-cloudformation/references/{validate-cloudformation-template.script.md → validate-with-cfn-lint.script.md} +15 -27
- package/dist/global-skills/aws-cloudformation/references/validate-with-cloudformation-validate.script.md +181 -0
- package/dist/global-skills/aws-cloudformation/references/validation-tool-selection.md +44 -0
- package/dist/global-skills/aws-serverless/SKILL.md +9 -1
- package/dist/global-skills/aws-serverless/references/architecture.md +3 -1
- package/dist/global-skills/aws-serverless/references/lambda.md +3 -1
- package/dist/global-skills/aws-serverless/references/orchestration.md +1 -0
- package/dist/global-skills/better-auth-best-practices/SKILL.md +18 -8
- package/dist/global-skills/eas-app-stores/SKILL.md +31 -15
- package/dist/global-skills/eas-app-stores/agents/openai.yaml +2 -2
- package/dist/global-skills/eas-app-stores/references/ios-app-store.md +37 -32
- package/dist/global-skills/eas-app-stores/references/native-ios.md +167 -0
- package/dist/global-skills/eas-app-stores/references/play-store.md +3 -7
- package/dist/global-skills/eas-app-stores/references/testflight.md +39 -35
- package/dist/global-skills/eas-simulator/SKILL.md +48 -26
- package/dist/global-skills/eas-simulator/references/controllers.md +32 -3
- package/dist/global-skills/eas-simulator/references/run-your-app.md +34 -4
- package/dist/global-skills/eas-simulator/references/troubleshooting.md +8 -4
- package/dist/global-skills/eas-update/SKILL.md +146 -0
- package/dist/global-skills/eas-update/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-animation/RECIPES.md +2 -2
- package/dist/global-skills/expo-animation/SKILL.md +9 -2
- package/dist/global-skills/expo-brownfield/SKILL.md +18 -11
- package/dist/global-skills/expo-brownfield/agents/openai.yaml +2 -2
- package/dist/global-skills/expo-brownfield/references/brownfield-integrated.md +94 -69
- package/dist/global-skills/expo-brownfield/references/brownfield-isolated.md +40 -42
- package/dist/global-skills/expo-brownfield/references/comparison.md +5 -5
- package/dist/global-skills/expo-brownfield/references/feature-integration.md +163 -0
- package/dist/global-skills/expo-brownfield/references/troubleshooting.md +17 -17
- package/dist/global-skills/expo-brownfield/references/version-compatibility.md +40 -0
- package/dist/global-skills/expo-data-fetching/SKILL.md +27 -6
- package/dist/global-skills/expo-design-system/SKILL.md +27 -7
- package/dist/global-skills/expo-design-system/references/audit.md +7 -2
- package/dist/global-skills/expo-design-system/references/native-slop.md +74 -0
- package/dist/global-skills/expo-examples/SKILL.md +0 -1
- package/dist/global-skills/expo-examples/references/catalog.md +1 -1
- package/dist/global-skills/expo-migrate-module/SKILL.md +21 -10
- package/dist/global-skills/expo-migrate-module/references/compatibility.md +80 -23
- package/dist/global-skills/expo-migrate-module/references/migration-map.md +162 -11
- package/dist/global-skills/expo-native-ui/SKILL.md +25 -16
- package/dist/global-skills/expo-native-ui/agents/openai.yaml +2 -2
- package/dist/global-skills/expo-native-ui/references/controls.md +5 -46
- package/dist/global-skills/expo-native-ui/references/icons.md +21 -2
- package/dist/global-skills/expo-native-ui/references/media.md +15 -20
- package/dist/global-skills/expo-native-ui/references/visual-effects.md +12 -11
- package/dist/global-skills/expo-overview/SKILL.md +17 -12
- package/dist/global-skills/expo-router/SKILL.md +5 -3
- package/dist/global-skills/expo-router/references/tabs.md +5 -5
- package/dist/global-skills/expo-upgrade/SKILL.md +3 -1
- package/dist/global-skills/expo-web-to-native/references/false-friends.md +2 -2
- package/dist/global-skills/expo-web-to-native/references/native-patterns.md +1 -1
- package/dist/global-skills/firebase-ai-logic-basics/SKILL.md +13 -16
- package/dist/global-skills/firebase-ai-logic-basics/references/ios_setup.md +4 -5
- package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_android.md +4 -4
- package/dist/global-skills/firebase-ai-logic-basics/references/usage_patterns_web.md +3 -3
- package/dist/global-skills/firebase-auth-basics/SKILL.md +11 -6
- package/dist/global-skills/firebase-auth-basics/references/client_sdk_android.md +4 -5
- package/dist/global-skills/firebase-auth-basics/references/client_sdk_web.md +3 -3
- package/dist/global-skills/firebase-auth-basics/references/flutter_setup.md +24 -25
- package/dist/global-skills/firebase-auth-basics/references/security_rules.md +4 -2
- package/dist/global-skills/firebase-crashlytics/references/android_setup.md +7 -4
- package/dist/global-skills/firebase-crashlytics/references/ios_setup.md +2 -3
- package/dist/global-skills/firebase-data-connect/SKILL.md +2 -1
- package/dist/global-skills/firebase-data-connect/examples.md +4 -4
- package/dist/global-skills/firebase-data-connect/reference/config.md +5 -4
- package/dist/global-skills/firebase-data-connect/reference/realtime.md +1 -2
- package/dist/global-skills/firebase-data-connect/reference/sdk_flutter.md +2 -2
- package/dist/global-skills/firebase-data-connect/reference/sdk_ios.md +2 -2
- package/dist/global-skills/firebase-data-connect/reference/sdk_web.md +17 -6
- package/dist/global-skills/firebase-data-connect/reference/security.md +5 -5
- package/dist/global-skills/firebase-data-connect/templates.md +2 -1
- package/dist/global-skills/firebase-firestore/SKILL.md +20 -8
- package/dist/global-skills/firebase-firestore/references/enterprise/android_sdk_usage.md +5 -4
- package/dist/global-skills/firebase-firestore/references/enterprise/data_model.md +12 -3
- package/dist/global-skills/firebase-firestore/references/enterprise/indexes.md +16 -18
- package/dist/global-skills/firebase-firestore/references/enterprise/provisioning.md +1 -1
- package/dist/global-skills/firebase-firestore/references/enterprise/python_sdk_usage.md +5 -1
- package/dist/global-skills/firebase-firestore/references/enterprise/web_sdk_usage.md +7 -7
- package/dist/global-skills/firebase-firestore/references/standard/android_sdk_usage.md +5 -5
- package/dist/global-skills/firebase-firestore/references/standard/flutter_setup.md +4 -4
- package/dist/global-skills/firebase-firestore/references/standard/indexes.md +16 -18
- package/dist/global-skills/firebase-firestore/references/standard/provisioning.md +1 -1
- package/dist/global-skills/firebase-remote-config-basics/SKILL.md +0 -5
- package/dist/global-skills/firebase-remote-config-basics/references/android_setup.md +36 -8
- package/dist/global-skills/firebase-remote-config-basics/references/ios_setup.md +1 -7
- package/dist/global-skills/firebase-security-rules-auditor/SKILL.md +17 -6
- package/dist/global-skills/{firebase-firestore/references/standard/security_rules.md → firestore-rules-creation/SKILL.md} +24 -13
- package/dist/global-skills/grow-my-customers/SKILL.md +23 -0
- package/dist/global-skills/instrument-feature-flags/SKILL.md +25 -25
- package/dist/global-skills/instrument-feature-flags/references/adding-feature-flag-code.md +141 -285
- package/dist/global-skills/instrument-feature-flags/references/android.md +6 -15
- package/dist/global-skills/instrument-feature-flags/references/api.md +4 -11
- package/dist/global-skills/instrument-feature-flags/references/best-practices.md +1 -13
- package/dist/global-skills/instrument-feature-flags/references/django.md +14 -27
- package/dist/global-skills/instrument-feature-flags/references/dotnet.md +20 -79
- package/dist/global-skills/instrument-feature-flags/references/elixir.md +1 -9
- package/dist/global-skills/instrument-feature-flags/references/flask.md +13 -13
- package/dist/global-skills/instrument-feature-flags/references/flutter.md +3 -24
- package/dist/global-skills/instrument-feature-flags/references/go.md +3 -15
- package/dist/global-skills/instrument-feature-flags/references/ios.md +4 -17
- package/dist/global-skills/instrument-feature-flags/references/java.md +5 -13
- package/dist/global-skills/instrument-feature-flags/references/laravel.md +13 -17
- package/dist/global-skills/instrument-feature-flags/references/next-js.md +25 -32
- package/dist/global-skills/instrument-feature-flags/references/nodejs.md +8 -15
- package/dist/global-skills/instrument-feature-flags/references/php.md +1 -15
- package/dist/global-skills/instrument-feature-flags/references/python.md +2 -15
- package/dist/global-skills/instrument-feature-flags/references/react-native.md +13 -15
- package/dist/global-skills/instrument-feature-flags/references/react.md +17 -21
- package/dist/global-skills/instrument-feature-flags/references/ruby-on-rails.md +37 -83
- package/dist/global-skills/instrument-feature-flags/references/ruby.md +2 -15
- package/dist/global-skills/instrument-feature-flags/references/rust.md +13 -25
- package/dist/global-skills/instrument-feature-flags/references/usage.md +14 -63
- package/dist/global-skills/instrument-feature-flags/references/web.md +9 -14
- package/dist/global-skills/instrument-product-analytics/SKILL.md +29 -29
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-hybrid.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-ssr.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-static.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-view-transitions.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-ruby-on-rails.md +3 -1
- package/dist/global-skills/instrument-product-analytics/references/android.md +72 -107
- package/dist/global-skills/instrument-product-analytics/references/angular.md +26 -28
- package/dist/global-skills/instrument-product-analytics/references/astro.md +13 -24
- package/dist/global-skills/instrument-product-analytics/references/configuration.md +45 -63
- package/dist/global-skills/instrument-product-analytics/references/django.md +14 -27
- package/dist/global-skills/instrument-product-analytics/references/dotnet.md +20 -79
- package/dist/global-skills/instrument-product-analytics/references/elixir.md +47 -49
- package/dist/global-skills/instrument-product-analytics/references/flask.md +13 -13
- package/dist/global-skills/instrument-product-analytics/references/flutter.md +60 -90
- package/dist/global-skills/instrument-product-analytics/references/go.md +17 -56
- package/dist/global-skills/instrument-product-analytics/references/identify-users.md +15 -15
- package/dist/global-skills/instrument-product-analytics/references/ios.md +11 -15
- package/dist/global-skills/instrument-product-analytics/references/laravel.md +13 -17
- package/dist/global-skills/instrument-product-analytics/references/next-js.md +25 -32
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js-3-6.md +13 -27
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js.md +14 -28
- package/dist/global-skills/instrument-product-analytics/references/php.md +33 -84
- package/dist/global-skills/instrument-product-analytics/references/posthog-python.md +229 -9
- package/dist/global-skills/instrument-product-analytics/references/python.md +415 -106
- package/dist/global-skills/instrument-product-analytics/references/react-native.md +161 -155
- package/dist/global-skills/instrument-product-analytics/references/react-router-v6.md +12 -33
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-data-mode.md +15 -33
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-declarative-mode.md +12 -33
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-framework-mode.md +26 -41
- package/dist/global-skills/instrument-product-analytics/references/ruby-on-rails.md +37 -83
- package/dist/global-skills/instrument-product-analytics/references/ruby.md +48 -108
- package/dist/global-skills/instrument-product-analytics/references/svelte.md +18 -24
- package/dist/global-skills/instrument-product-analytics/references/tanstack-start.md +17 -19
- package/dist/global-skills/instrument-product-analytics/references/usage.md +14 -63
- package/dist/global-skills/instrument-product-analytics/references/vue-js.md +29 -28
- package/dist/global-skills/manifest.json +8 -2
- package/dist/global-skills/mongodb-search-and-ai/SKILL.md +28 -37
- package/dist/global-skills/mongodb-search-and-ai/references/automated-embedding.md +438 -0
- package/dist/global-skills/mongodb-search-and-ai/references/hybrid-search.md +60 -4
- package/dist/global-skills/mongodb-search-and-ai/references/vector-search.md +46 -108
- package/dist/global-skills/neon/SKILL.md +207 -213
- package/dist/global-skills/neon/references/auth.md +12 -0
- package/dist/global-skills/neon/references/claimable-neon.md +10 -14
- package/dist/global-skills/neon/references/function-triggers.md +53 -0
- package/dist/global-skills/neon/references/logs-loki.md +61 -0
- package/dist/global-skills/neon/references/parse-env.md +32 -0
- package/dist/global-skills/neon/references/sdk.md +7 -0
- package/dist/global-skills/neon-ai-gateway/SKILL.md +14 -16
- package/dist/global-skills/neon-auth/SKILL.md +155 -0
- package/dist/global-skills/neon-auth/references/managed-auth.md +173 -0
- package/dist/global-skills/neon-auth/references/self-managed.md +25 -0
- package/dist/global-skills/neon-functions/SKILL.md +159 -84
- package/dist/global-skills/neon-functions/references/ai-sdk.md +4 -6
- package/dist/global-skills/neon-functions/references/function-triggers.md +249 -0
- package/dist/global-skills/neon-functions/references/mastra-studio.md +3 -3
- package/dist/global-skills/neon-functions/references/mcp.md +1 -1
- package/dist/global-skills/neon-functions/references/production-hardening.md +340 -0
- package/dist/global-skills/neon-functions/references/sse.md +8 -5
- package/dist/global-skills/neon-object-storage/SKILL.md +10 -11
- package/dist/global-skills/neon-postgres/SKILL.md +120 -17
- package/dist/global-skills/neon-postgres/references/full-text-search.md +99 -0
- package/dist/global-skills/neon-postgres/references/hybrid-search.md +90 -0
- package/dist/global-skills/neon-postgres/references/lakebase-search-drizzle.md +172 -0
- package/dist/global-skills/neon-postgres/references/vector-search.md +137 -0
- package/dist/global-skills/neon-postgres-branches/SKILL.md +3 -3
- package/dist/global-skills/neon-postgres-egress-optimizer/SKILL.md +1 -1
- package/dist/global-skills/onboarding/SKILL.md +8 -6
- package/dist/global-skills/resend/SKILL.md +4 -2
- package/dist/global-skills/resend/references/broadcasts.md +6 -1
- package/dist/global-skills/resend/references/receiving.md +29 -10
- package/dist/global-skills/resend/references/sending/email-management.md +14 -4
- package/dist/global-skills/resend/references/topics.md +9 -6
- package/dist/global-skills/resend/references/usage.md +117 -0
- package/dist/global-skills/resend/references/webhooks.md +59 -2
- package/dist/global-skills/stripe-best-practices/SKILL.md +35 -29
- package/dist/global-skills/stripe-best-practices/references/billing.md +9 -2
- package/dist/global-skills/stripe-best-practices/references/payments.md +4 -2
- package/dist/global-skills/stripe-best-practices/references/security.md +3 -1
- package/dist/global-skills/stripe-best-practices/references/tax.md +39 -20
- package/dist/global-skills/supabase/SKILL.md +6 -0
- package/dist/global-skills/use-railway/SKILL.md +42 -22
- package/dist/global-skills/use-railway/references/analyze-db.md +7 -6
- package/dist/global-skills/use-railway/references/cloud-agents.md +70 -0
- package/dist/global-skills/use-railway/references/configure.md +17 -2
- package/dist/global-skills/use-railway/references/databases.md +107 -0
- package/dist/global-skills/use-railway/references/deploy.md +5 -5
- package/dist/global-skills/use-railway/references/feature-flags.md +25 -13
- package/dist/global-skills/use-railway/references/iac.md +66 -77
- package/dist/global-skills/use-railway/references/operate.md +26 -3
- package/dist/global-skills/use-railway/references/request.md +31 -23
- package/dist/global-skills/use-railway/references/setup.md +16 -5
- package/dist/global-skills/use-railway/references/tracing.md +261 -0
- package/dist/global-skills/use-railway/references/usage.md +52 -0
- package/dist/global-skills/validate-my-idea/SKILL.md +54 -0
- package/dist/global-skills/{feedback → vybekiit-feedback}/SKILL.md +16 -12
- package/dist/global-skills/watch-my-app/SKILL.md +53 -0
- package/dist/global-skills/workers-best-practices/SKILL.md +36 -103
- package/dist/global-skills/workers-best-practices/references/configuration.md +139 -0
- package/dist/global-skills/workers-best-practices/references/platform-apis.md +51 -0
- package/dist/global-skills/workers-best-practices/references/{rules.md → runtime-patterns.md} +13 -137
- package/dist/global-skills/wrangler/SKILL.md +48 -901
- package/dist/global-skills/xcode-project-setup/scripts/xcode_spm_setup/Sources/main.swift +19 -15
- package/package.json +9 -8
- package/dist/global-skills/expo-native-ui/references/animations.md +0 -220
- package/dist/global-skills/firebase-firestore/references/enterprise/security_rules.md +0 -577
- package/dist/global-skills/workers-best-practices/references/review.md +0 -174
|
@@ -36,7 +36,6 @@ Main SQL Connect service configuration:
|
|
|
36
36
|
specVersion: "v1"
|
|
37
37
|
serviceId: "my-service"
|
|
38
38
|
location: "us-central1"
|
|
39
|
-
schemaValidation: "STRICT" # or "COMPATIBLE"
|
|
40
39
|
schema:
|
|
41
40
|
source: "./schema"
|
|
42
41
|
datasource:
|
|
@@ -44,6 +43,7 @@ schema:
|
|
|
44
43
|
database: "fdcdb"
|
|
45
44
|
cloudSql:
|
|
46
45
|
instanceId: "my-instance"
|
|
46
|
+
schemaValidation: "STRICT" # or "COMPATIBLE"
|
|
47
47
|
connectorDirs: ["./connector"]
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -52,7 +52,7 @@ connectorDirs: ["./connector"]
|
|
|
52
52
|
| `specVersion` | Always `"v1"` |
|
|
53
53
|
| `serviceId` | Unique identifier for the service |
|
|
54
54
|
| `location` | GCP region (us-central1, us-east4, europe-west1, etc.) |
|
|
55
|
-
| `schemaValidation`
|
|
55
|
+
| `schema.datasource.postgresql.schemaValidation` | Deployment mode: `"STRICT"` (must match exactly) or `"COMPATIBLE"` (backward compatible) |
|
|
56
56
|
| `schema.source` | Path to schema directory |
|
|
57
57
|
| `schema.datasource` | PostgreSQL connection config |
|
|
58
58
|
| `connectorDirs` | List of connector directories |
|
|
@@ -85,6 +85,7 @@ generate:
|
|
|
85
85
|
package: "com.myapp.dataconnect"
|
|
86
86
|
swiftSdk:
|
|
87
87
|
outputDir: "../ios/MyApp/DataConnect"
|
|
88
|
+
package: "DataConnectGenerated"
|
|
88
89
|
```
|
|
89
90
|
|
|
90
91
|
### SDK Generation Options
|
|
@@ -93,8 +94,8 @@ generate:
|
|
|
93
94
|
| --------------- | -------------------------------------- |
|
|
94
95
|
| `javascriptSdk` | `outputDir`, `package` |
|
|
95
96
|
| `kotlinSdk` | `outputDir`, `package` |
|
|
96
|
-
| `swiftSdk` | `outputDir`
|
|
97
|
-
| `
|
|
97
|
+
| `swiftSdk` | `outputDir`, `package` |
|
|
98
|
+
| `adminNodeSdk` | `outputDir`, `package` (for Admin SDK) |
|
|
98
99
|
|
|
99
100
|
______________________________________________________________________
|
|
100
101
|
|
|
@@ -23,8 +23,7 @@ based on what you're querying:
|
|
|
23
23
|
List queries require explicit `@refresh` to tell SQL Connect which mutations
|
|
24
24
|
affect the result set.
|
|
25
25
|
|
|
26
|
-
Clients consume all three using `subscribe()` instead of `execute()`. See
|
|
27
|
-
[sdks.md](sdks.md) for per-platform subscribe patterns.
|
|
26
|
+
Clients consume all three using `subscribe()` instead of `execute()`. See [sdk_web.md](sdk_web.md), [sdk_android.md](sdk_android.md), [sdk_ios.md](sdk_ios.md), and [sdk_flutter.md](sdk_flutter.md) for per-platform subscribe patterns.
|
|
28
27
|
|
|
29
28
|
______________________________________________________________________
|
|
30
29
|
|
|
@@ -66,8 +66,8 @@ is old).
|
|
|
66
66
|
```dart
|
|
67
67
|
final result = await MoviesConnector.instance.listMovies().execute();
|
|
68
68
|
|
|
69
|
-
if (result.data
|
|
70
|
-
handleEnumValue(result.data
|
|
69
|
+
if (result.data.movies.isNotEmpty) {
|
|
70
|
+
handleEnumValue(result.data.movies[0].aspectratio);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
void handleEnumValue(EnumValue<AspectRatio> aspectValue) {
|
|
@@ -103,8 +103,8 @@ generate:
|
|
|
103
103
|
Use cache policies in code:
|
|
104
104
|
|
|
105
105
|
```swift
|
|
106
|
-
try await execute(fetchPolicy: .cacheOnly)
|
|
107
|
-
try await execute(fetchPolicy: .serverOnly)
|
|
106
|
+
try await queryRef.execute(fetchPolicy: .cacheOnly)
|
|
107
|
+
try await queryRef.execute(fetchPolicy: .serverOnly)
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
### Subscriptions (Realtime)
|
|
@@ -100,15 +100,17 @@ generate:
|
|
|
100
100
|
Use policies in code:
|
|
101
101
|
|
|
102
102
|
```typescript
|
|
103
|
-
await executeQuery(queryRef, QueryFetchPolicy.CACHE_ONLY);
|
|
104
|
-
await executeQuery(queryRef, QueryFetchPolicy.SERVER_ONLY);
|
|
103
|
+
await executeQuery(queryRef, { fetchPolicy: QueryFetchPolicy.CACHE_ONLY });
|
|
104
|
+
await executeQuery(queryRef, { fetchPolicy: QueryFetchPolicy.SERVER_ONLY });
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
### Subscriptions (Realtime)
|
|
108
108
|
|
|
109
|
-
Use `subscribe()` to receive live updates.
|
|
109
|
+
Use `subscribe()` to receive live updates. It accepts either an observer object (`SubscriptionOptions`) or positional callbacks:
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
> **Note:** When passing an observer object literal, the error callback property is named **`onErr`** (`{ onNext, onErr, onComplete }`). Passing `onError` in an object literal fails TypeScript compilation (`TS2769`) and is ignored at runtime. The name `onError` is only used as the parameter name in the positional callback overload (`subscribe(ref, onNext, onError, onComplete)`).
|
|
112
|
+
|
|
113
|
+
#### Web (Vanilla JS / TypeScript)
|
|
112
114
|
|
|
113
115
|
```typescript
|
|
114
116
|
import { subscribe } from 'firebase/data-connect';
|
|
@@ -116,9 +118,18 @@ import { getMovieByIdRef } from '@dataconnect/generated';
|
|
|
116
118
|
|
|
117
119
|
const queryRef = getMovieByIdRef({ id: "<MOVIE_ID>" });
|
|
118
120
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
// Option 1: Observer object (recommended — uses `onErr`)
|
|
122
|
+
const unsubscribe = subscribe(queryRef, {
|
|
123
|
+
onNext: (result) => console.log("Updated result:", result),
|
|
124
|
+
onErr: (error) => console.error("Subscription error:", error)
|
|
121
125
|
});
|
|
126
|
+
|
|
127
|
+
// Option 2: Positional callbacks (`onNext`, `onError`, `onComplete`)
|
|
128
|
+
const unsubscribePositional = subscribe(
|
|
129
|
+
queryRef,
|
|
130
|
+
(result) => console.log("Updated result:", result),
|
|
131
|
+
(error) => console.error("Subscription error:", error)
|
|
132
|
+
);
|
|
122
133
|
```
|
|
123
134
|
|
|
124
135
|
### TanStack Query Support (React)
|
|
@@ -35,9 +35,9 @@ ______________________________________________________________________
|
|
|
35
35
|
| Level | Who Can Access | CEL Equivalent |
|
|
36
36
|
| --------------------- | -------------------------------------------- | ------------------------------------------------------------------------ |
|
|
37
37
|
| `PUBLIC` | Anyone, authenticated or not | `true` |
|
|
38
|
-
| `USER_ANON` | Any authenticated user (including anonymous) | `auth
|
|
39
|
-
| `USER` | Authenticated users (excludes anonymous) | `auth
|
|
40
|
-
| `USER_EMAIL_VERIFIED` | Users with verified email | `auth
|
|
38
|
+
| `USER_ANON` | Any authenticated user (including anonymous) | `auth != null` |
|
|
39
|
+
| `USER` | Authenticated users (excludes anonymous) | `auth != null && auth.token.firebase.sign_in_provider != 'anonymous'` |
|
|
40
|
+
| `USER_EMAIL_VERIFIED` | Users with verified email | `auth != null && auth.token.email_verified` |
|
|
41
41
|
| `NO_ACCESS` | Admin SDK only | `false` |
|
|
42
42
|
|
|
43
43
|
> **Important:** Levels like `USER` are starting points. Always add filters or
|
|
@@ -55,7 +55,7 @@ ______________________________________________________________________
|
|
|
55
55
|
| `auth.token` | Auth token claims (see below) |
|
|
56
56
|
| `vars` | Operation variables (e.g., `vars.movieId`) |
|
|
57
57
|
| `request.time` | Server timestamp |
|
|
58
|
-
| `request.operationName` |
|
|
58
|
+
| `request.operationName` | Name of the GraphQL operation being executed (e.g., `"GetMovie"`) |
|
|
59
59
|
|
|
60
60
|
### auth.token Fields
|
|
61
61
|
|
|
@@ -79,7 +79,7 @@ ______________________________________________________________________
|
|
|
79
79
|
@auth(expr: "auth.token.email_verified && auth.token.email.endsWith('@company.com')")
|
|
80
80
|
|
|
81
81
|
# Check multiple conditions
|
|
82
|
-
@auth(expr: "auth
|
|
82
|
+
@auth(expr: "auth != null && (auth.token.role == 'editor' || auth.token.role == 'admin')")
|
|
83
83
|
|
|
84
84
|
# Check variable
|
|
85
85
|
@auth(expr: "has(vars.status) && vars.status in ['draft', 'published']")
|
|
@@ -202,6 +202,7 @@ generate:
|
|
|
202
202
|
package: "com.myapp.dataconnect"
|
|
203
203
|
swiftSdk:
|
|
204
204
|
outputDir: "../ios/MyApp/DataConnect"
|
|
205
|
+
package: "DataConnectGenerated"
|
|
205
206
|
dartSdk:
|
|
206
207
|
outputDir: "../flutter/lib/dataconnect"
|
|
207
208
|
package: myapp_dataconnect
|
|
@@ -310,7 +311,7 @@ const unsubscribe = subscribe(liveDashboardRef(), {
|
|
|
310
311
|
// Called immediately with current data, then on each refresh
|
|
311
312
|
renderDashboard(result.data.items);
|
|
312
313
|
},
|
|
313
|
-
|
|
314
|
+
onErr: (error) => console.error('Subscription error:', error) // Observer object property is `onErr` (positional overload parameter is `onError`)
|
|
314
315
|
});
|
|
315
316
|
|
|
316
317
|
// Cleanup when done
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: firebase-firestore
|
|
3
3
|
description: >-
|
|
4
|
-
Sets up, manages, queries, and configures Cloud Firestore databases (Standard/Enterprise edition), including data modeling, security rules, indexes, and SDK integrations (Web, Python, iOS, Android, Flutter). Use when creating/listing Firestore databases, defining data models/indexes, writing SDK queries, or integrating Firestore SDKs. Don't use for Firebase Hosting, Data Connect, Auth, Storage/GCS, Crashlytics, Functions, or BigQuery.
|
|
4
|
+
Sets up, manages, queries, and configures Cloud Firestore databases (Standard/Enterprise edition), including data modeling, security rules, indexes, and SDK integrations (Web, Python, iOS, Android, Flutter). Use when creating/listing Firestore databases, defining data models/indexes, writing SDK queries, or integrating Firestore SDKs. For authoring or modifying Firestore Security Rules (firestore.rules), delegate to the firestore-rules-author subagent if subagent delegation is available, or use firestore-rules-creation otherwise. Don't use for Firebase Hosting, Data Connect, Auth, Storage/GCS, Crashlytics, Functions, or BigQuery.
|
|
5
5
|
compatibility: This skill is best used with the Firebase CLI, but does not require it. Firebase CLI can be accessed through `npx -y firebase-tools@latest`.
|
|
6
6
|
metadata:
|
|
7
7
|
category: Databases
|
|
@@ -9,18 +9,29 @@ metadata:
|
|
|
9
9
|
|
|
10
10
|
# Cloud Firestore Database and Operations
|
|
11
11
|
|
|
12
|
+
> [!IMPORTANT] **Security Rules Authoring (`firestore.rules`)**
|
|
13
|
+
> Whenever your task requires creating, authoring, or modifying `firestore.rules`:
|
|
14
|
+
> - **If subagent delegation AND the `firestore-rules-author` subagent are available**: delegate authoring `firestore.rules` to the `firestore-rules-author` subagent rather than writing `firestore.rules` directly in the main agent.
|
|
15
|
+
> - **If subagent delegation is unavailable** (e.g., subagents not enabled in the IDE) **OR `firestore-rules-author` is not installed**: read and follow the `firestore-rules-creation` skill to write `firestore.rules` directly.
|
|
16
|
+
|
|
12
17
|
Before setting up dependencies, writing data models, or configuring security
|
|
13
18
|
rules, you MUST always identify the Firestore instance edition.
|
|
14
19
|
|
|
15
20
|
## 1. Instance Selection and Edition Detection
|
|
16
21
|
|
|
17
22
|
Run the following command to list current Firestore databases:
|
|
18
|
-
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx -y firebase-tools@latest firestore:databases:list
|
|
26
|
+
```
|
|
19
27
|
|
|
20
28
|
### A. Instance Found
|
|
21
29
|
|
|
22
30
|
1. For each database found, inspect its edition and details:
|
|
23
|
-
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx -y firebase-tools@latest firestore:databases:get <database-id>
|
|
34
|
+
```
|
|
24
35
|
1. Ask the user which database instance they wish to target or if they would
|
|
25
36
|
prefer to create a new instance.
|
|
26
37
|
1. Once the target instance is established:
|
|
@@ -37,7 +48,10 @@ If no databases exist or the user requests a new one, default to provisioning an
|
|
|
37
48
|
Suggest colocating with other resources if applicable.
|
|
38
49
|
|
|
39
50
|
Once the location is determined, create the database:
|
|
40
|
-
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx -y firebase-tools@latest firestore:databases:create <database-id> --edition="enterprise" --location="<selected-location>"
|
|
54
|
+
```
|
|
41
55
|
|
|
42
56
|
Proceed with using the guides under `references/enterprise/`.
|
|
43
57
|
|
|
@@ -51,8 +65,7 @@ corresponding reference guides:
|
|
|
51
65
|
### Standard Edition (`references/standard/`)
|
|
52
66
|
|
|
53
67
|
- **Provisioning**: Read [provisioning.md](references/standard/provisioning.md)
|
|
54
|
-
- **Security Rules**:
|
|
55
|
-
[security_rules.md](references/standard/security_rules.md)
|
|
68
|
+
- **Security Rules**: See the `firestore-rules-creation` skill
|
|
56
69
|
- **SDK Usage**: Read [web_sdk_usage.md](references/standard/web_sdk_usage.md),
|
|
57
70
|
[android_sdk_usage.md](references/standard/android_sdk_usage.md),
|
|
58
71
|
[ios_setup.md](references/standard/ios_setup.md), or
|
|
@@ -66,8 +79,7 @@ corresponding reference guides:
|
|
|
66
79
|
|
|
67
80
|
- **Data Model**: Read [data_model.md](references/enterprise/data_model.md)
|
|
68
81
|
|
|
69
|
-
- **Security Rules**:
|
|
70
|
-
[security_rules.md](references/enterprise/security_rules.md)
|
|
82
|
+
- **Security Rules**: See the `firestore-rules-creation` skill
|
|
71
83
|
|
|
72
84
|
- **SDK Usage**:
|
|
73
85
|
|
|
@@ -135,7 +135,7 @@ val articlesWithAuthProfile = db.pipeline().collection("articles")
|
|
|
135
135
|
.define(field("authorUid").alias("author_id"))
|
|
136
136
|
.addFields(
|
|
137
137
|
db.pipeline().collection("users")
|
|
138
|
-
.where(field("__name__").documentId().
|
|
138
|
+
.where(field("__name__").documentId().equal(variable("author_id")))
|
|
139
139
|
.select(field("displayName"), field("avatarUrl"), field("handle"))
|
|
140
140
|
.toScalarExpression()
|
|
141
141
|
.alias("author")
|
|
@@ -150,13 +150,14 @@ high-performance text query matches on the database level.
|
|
|
150
150
|
```kotlin
|
|
151
151
|
import com.google.firebase.firestore.pipeline.Expression.documentMatches
|
|
152
152
|
import com.google.firebase.firestore.pipeline.Expression.score
|
|
153
|
+
import com.google.firebase.firestore.pipeline.SearchStage
|
|
153
154
|
|
|
154
155
|
// Execute full-text search inside a pipeline, sorted by relevance score descending
|
|
155
156
|
val searchPipeline = db.pipeline()
|
|
156
157
|
.collection("articles")
|
|
157
158
|
.search(
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
SearchStage.withQuery(documentMatches("machine learning"))
|
|
160
|
+
.withSort(score().descending())
|
|
160
161
|
)
|
|
161
162
|
.limit(5)
|
|
162
163
|
```
|
|
@@ -175,7 +176,7 @@ import com.google.firebase.Firebase
|
|
|
175
176
|
import com.google.firebase.firestore.DocumentChange
|
|
176
177
|
import com.google.firebase.firestore.firestore
|
|
177
178
|
|
|
178
|
-
val db = Firebase.firestore
|
|
179
|
+
val db = Firebase.firestore("<database-name>")
|
|
179
180
|
// 1. Add a new document to a collection
|
|
180
181
|
val taskData = hashMapOf(
|
|
181
182
|
"title" to "Refactor Android SDK Usage Guide",
|
|
@@ -16,7 +16,10 @@ nested objects in addition to basic data types like strings, numbers, and
|
|
|
16
16
|
booleans. Documents are limited to a maximum size of 1 MiB.
|
|
17
17
|
|
|
18
18
|
Example document (e.g., in a `users` collection):
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{ "first": "Ada", "last": "Lovelace", "born": 1815 }
|
|
22
|
+
```
|
|
20
23
|
|
|
21
24
|
### Collections
|
|
22
25
|
|
|
@@ -60,7 +63,13 @@ the `reviews` collection group.
|
|
|
60
63
|
|
|
61
64
|
**Standard Query** (Single Collection): Find all 5-star reviews for a specific
|
|
62
65
|
landmark.
|
|
63
|
-
|
|
66
|
+
|
|
67
|
+
```javascript
|
|
68
|
+
db.collection('landmarks/golden_gate_bridge/reviews').where('rating', '==', 5)
|
|
69
|
+
```
|
|
64
70
|
|
|
65
71
|
**Collection Group Query**: Find all 5-star reviews across *all* landmarks.
|
|
66
|
-
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
db.collectionGroup('reviews').where('rating', '==', 5)
|
|
75
|
+
```
|
|
@@ -43,23 +43,18 @@ create index entries with duplicate values.
|
|
|
43
43
|
|
|
44
44
|
## Query Support Examples
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
| : ">", 1).where("b", ">", 2)` :`b\` : | |
|
|
59
|
-
| \*\*Array Contains + | **Composite Index** on field `tags` |
|
|
60
|
-
| : Equality\*\*<br>`where("tags", : and `active\` : | |
|
|
61
|
-
| : "array-contains", : : | |
|
|
62
|
-
| : "news").where("active", "==", true)\` : : | |
|
|
46
|
+
- **Simple Equality**: `where("a", "==", 1)`
|
|
47
|
+
- Index Required: Single-Field Index on field `a`
|
|
48
|
+
- **Simple Range/Sort**: `where("a", ">", 1).orderBy("a")`
|
|
49
|
+
- Index Required: Single-Field Index on field `a`
|
|
50
|
+
- **Multiple Equality**: `where("a", "==", 1).where("b", "==", 2)`
|
|
51
|
+
- Index Required: Single-Field Index on field `a` and `b`
|
|
52
|
+
- **Equality + Range/Sort**: `where("a", "==", 1).where("b", ">", 2)`
|
|
53
|
+
- Index Required: **Composite Index** on field `a` and `b`
|
|
54
|
+
- **Multiple Ranges**: `where("a", ">", 1).where("b", ">", 2)`
|
|
55
|
+
- Index Required: **Composite Index** on field `a` and `b`
|
|
56
|
+
- **Array Contains + Equality**: `where("tags", "array-contains", "news").where("active", "==", true)`
|
|
57
|
+
- Index Required: **Composite Index** on field `tags` and `active`
|
|
63
58
|
|
|
64
59
|
If no indexes is present, Firestore Enterprise will perform a full collection
|
|
65
60
|
scan to find documents that match a query.
|
|
@@ -132,4 +127,7 @@ Define a unique index:
|
|
|
132
127
|
### CLI Commands
|
|
133
128
|
|
|
134
129
|
Deploy indexes only:
|
|
135
|
-
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npx -y firebase-tools@latest deploy --only firestore:indexes
|
|
133
|
+
```
|
|
@@ -11,6 +11,9 @@ Creates a document if it does not exist or overwrites it if it does. You can
|
|
|
11
11
|
also specify a merge option to only update provided fields.
|
|
12
12
|
|
|
13
13
|
```python
|
|
14
|
+
from google.cloud import firestore
|
|
15
|
+
|
|
16
|
+
db = firestore.Client(database="<database-id>")
|
|
14
17
|
city_ref = db.collection("cities").document("LA")
|
|
15
18
|
|
|
16
19
|
# Create/Overwrite
|
|
@@ -54,6 +57,7 @@ city_ref.update({
|
|
|
54
57
|
Perform an atomic read-modify-write operation.
|
|
55
58
|
|
|
56
59
|
```python
|
|
60
|
+
from google.cloud import firestore
|
|
57
61
|
from google.cloud.firestore import Transaction
|
|
58
62
|
|
|
59
63
|
transaction = db.transaction()
|
|
@@ -132,7 +136,7 @@ query = cities_ref.order_by("name").limit(3)
|
|
|
132
136
|
You can use pipeline queries to perform complex queries.
|
|
133
137
|
|
|
134
138
|
```python
|
|
135
|
-
pipeline =
|
|
139
|
+
pipeline = db.pipeline().collection("users")
|
|
136
140
|
for result in pipeline.execute():
|
|
137
141
|
print(f"{result.id} => {result.data()}")
|
|
138
142
|
```
|
|
@@ -18,7 +18,7 @@ const firebaseConfig = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const app = initializeApp(firebaseConfig);
|
|
21
|
-
const db = getFirestore(app);
|
|
21
|
+
const db = getFirestore(app, "<database-id>");
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
______________________________________________________________________
|
|
@@ -31,10 +31,8 @@ ______________________________________________________________________
|
|
|
31
31
|
|
|
32
32
|
### Rules & Accountability
|
|
33
33
|
|
|
34
|
-
1. **Check API References:** Always read `
|
|
35
|
-
`node_modules/@firebase/firestore/dist
|
|
36
|
-
querying. Reference `expressions.d.ts` in the same folder only when verifying
|
|
37
|
-
specific expressions, and never assume they exist.
|
|
34
|
+
1. **Check API References:** Always read `pipelines.d.ts` in
|
|
35
|
+
`node_modules/@firebase/firestore/dist/` before querying.
|
|
38
36
|
1. **Shift Processing to Backend:** Always aim to transform and filter data
|
|
39
37
|
dynamically at the database level via pipeline stages. Avoid local Javascript
|
|
40
38
|
arrays mapping, sorting, or aggregating client-side.
|
|
@@ -55,7 +53,7 @@ bind alias parameters. - Invoke `.addFields()` incorporating a new subquery
|
|
|
55
53
|
linking the documents.
|
|
56
54
|
|
|
57
55
|
```javascript
|
|
58
|
-
import { field, variable } from "firebase/firestore/pipelines";
|
|
56
|
+
import { execute, field, variable } from "firebase/firestore/pipelines";
|
|
59
57
|
|
|
60
58
|
// Fetch articles and join the associated author Profile side-by-side
|
|
61
59
|
const articlesWithAuthProfile = db.pipeline().collection("articles")
|
|
@@ -67,6 +65,7 @@ const articlesWithAuthProfile = db.pipeline().collection("articles")
|
|
|
67
65
|
.toScalarExpression()
|
|
68
66
|
.as("author")
|
|
69
67
|
);
|
|
68
|
+
const snapshot = await execute(articlesWithAuthProfile);
|
|
70
69
|
```
|
|
71
70
|
|
|
72
71
|
### Full-Text Search
|
|
@@ -75,7 +74,7 @@ Leverage the database-native `.search()` stage for high-performance text
|
|
|
75
74
|
lookups.
|
|
76
75
|
|
|
77
76
|
```javascript
|
|
78
|
-
import { documentMatches, score } from "firebase/firestore/pipelines";
|
|
77
|
+
import { documentMatches, execute, score } from "firebase/firestore/pipelines";
|
|
79
78
|
// Execute full-text search within pipeline
|
|
80
79
|
const searchPipeline = db.pipeline()
|
|
81
80
|
.collection("articles")
|
|
@@ -84,6 +83,7 @@ const searchPipeline = db.pipeline()
|
|
|
84
83
|
sort: score().descending()
|
|
85
84
|
})
|
|
86
85
|
.limit(5);
|
|
86
|
+
const results = await execute(searchPipeline);
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
______________________________________________________________________
|
|
@@ -37,9 +37,9 @@ ______________________________________________________________________
|
|
|
37
37
|
In your Activity or Fragment, initialize the `FirebaseFirestore` instance:
|
|
38
38
|
|
|
39
39
|
```kotlin
|
|
40
|
+
import com.google.firebase.Firebase
|
|
40
41
|
import com.google.firebase.firestore.FirebaseFirestore
|
|
41
|
-
import com.google.firebase.firestore.
|
|
42
|
-
import com.google.firebase.ktx.Firebase
|
|
42
|
+
import com.google.firebase.firestore.firestore
|
|
43
43
|
|
|
44
44
|
class MainActivity : AppCompatActivity() {
|
|
45
45
|
|
|
@@ -47,8 +47,8 @@ class MainActivity : AppCompatActivity() {
|
|
|
47
47
|
|
|
48
48
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
49
49
|
super.onCreate(savedInstanceState)
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
db = Firebase.firestore
|
|
51
|
+
|
|
52
52
|
setContent {
|
|
53
53
|
MaterialTheme {
|
|
54
54
|
Text("Firestore initialized!")
|
|
@@ -75,7 +75,7 @@ class MainActivity : ComponentActivity() {
|
|
|
75
75
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
76
76
|
super.onCreate(savedInstanceState)
|
|
77
77
|
val db = Firebase.firestore
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
setContent {
|
|
80
80
|
MaterialTheme {
|
|
81
81
|
Text("Firestore initialized!")
|
|
@@ -81,7 +81,7 @@ class ItemService {
|
|
|
81
81
|
try {
|
|
82
82
|
await _itemsRef.add(item.toFirestore());
|
|
83
83
|
} catch (e) {
|
|
84
|
-
print("Error creating document:
|
|
84
|
+
print("Error creating document: $e");
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -95,7 +95,7 @@ class ItemService {
|
|
|
95
95
|
|
|
96
96
|
return querySnapshot.docs.map((doc) => Item.fromFirestore(doc)).toList();
|
|
97
97
|
} catch (e) {
|
|
98
|
-
print("Error fetching documents:
|
|
98
|
+
print("Error fetching documents: $e");
|
|
99
99
|
return [];
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -118,7 +118,7 @@ class ItemService {
|
|
|
118
118
|
try {
|
|
119
119
|
await _itemsRef.doc(id).update({'name': newName});
|
|
120
120
|
} catch (e) {
|
|
121
|
-
print("Error updating document:
|
|
121
|
+
print("Error updating document: $e");
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -127,7 +127,7 @@ class ItemService {
|
|
|
127
127
|
try {
|
|
128
128
|
await _itemsRef.doc(id).delete();
|
|
129
129
|
} catch (e) {
|
|
130
|
-
print("Error deleting document:
|
|
130
|
+
print("Error deleting document: $e");
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -41,23 +41,18 @@ specific index.
|
|
|
41
41
|
|
|
42
42
|
## Query Support Examples
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
| : ">", 1).where("b", ">", 2)\` : limited query support) : | |
|
|
57
|
-
| \*\*Array Contains + | **Composite Index** |
|
|
58
|
-
| : Equality\*\*<br>\`where("tags", : : | |
|
|
59
|
-
| : "array-contains", : : | |
|
|
60
|
-
| : "news").where("active", "==", true)\` : : | |
|
|
44
|
+
- **Simple Equality**: `where("a", "==", 1)`
|
|
45
|
+
- Index Required: Automatic (Single-Field)
|
|
46
|
+
- **Simple Range/Sort**: `where("a", ">", 1).orderBy("a")`
|
|
47
|
+
- Index Required: Automatic (Single-Field)
|
|
48
|
+
- **Multiple Equality**: `where("a", "==", 1).where("b", "==", 2)`
|
|
49
|
+
- Index Required: Automatic (Merged Single-Field)
|
|
50
|
+
- **Equality + Range/Sort**: `where("a", "==", 1).where("b", ">", 2)`
|
|
51
|
+
- Index Required: **Composite Index**
|
|
52
|
+
- **Multiple Ranges**: `where("a", ">", 1).where("b", ">", 2)`
|
|
53
|
+
- Index Required: **Composite Index** (limited query support)
|
|
54
|
+
- **Array Contains + Equality**: `where("tags", "array-contains", "news").where("active", "==", true)`
|
|
55
|
+
- Index Required: **Composite Index**
|
|
61
56
|
|
|
62
57
|
## Best Practices & Exemptions
|
|
63
58
|
|
|
@@ -110,4 +105,7 @@ Your indexes should be defined in `firestore.indexes.json` (pointed to by
|
|
|
110
105
|
### CLI Commands
|
|
111
106
|
|
|
112
107
|
Deploy indexes only:
|
|
113
|
-
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx -y firebase-tools@latest deploy --only firestore:indexes
|
|
111
|
+
```
|
|
@@ -71,11 +71,6 @@ patterns (see
|
|
|
71
71
|
Use the following commands to manage your Remote Config template and version
|
|
72
72
|
history through the terminal:
|
|
73
73
|
|
|
74
|
-
### Template Management via CLI
|
|
75
|
-
|
|
76
|
-
Use the following commands to manage your Remote Config template and version
|
|
77
|
-
history through the terminal:
|
|
78
|
-
|
|
79
74
|
- **Get current template**: Save the remote template to a local JSON file for
|
|
80
75
|
auditing or modification.
|
|
81
76
|
|