id stringlengths 16 145 | text stringlengths 1 179k | title stringclasses 1
value |
|---|---|---|
firebase/queries4_401_0.txt | ### Kotlin+KTX
citiesRef.whereGreaterThanOrEqualTo("state", "CA")
.whereLessThanOrEqualTo("state", "IN")
citiesRef.whereEqualTo("state", "CA")
.whereGreaterThan("population", 1000000)
DocSnippets.kt | |
firebase/queries4_373_0.txt | Note the following limitations for ` in ` , ` not-in ` , and ` array-contains-
any ` :
* Cloud Firestore provides support for logical ` OR ` queries through the ` or ` , ` in ` , and ` array-contains-any ` operators. These queries are limited to 30 disjunctions based on the query's disjunctive normal form .
* Y... | |
firebase/performance_monitoring_2_0.txt | [ 
](/)
*
[ Products ](https://firebase.google.com/products-build)
* [ Build ](https://firebase.google.com/products-build)
* [ Release & Monitor ](https://fir... | |
firebase/multiple-range-fields5_52_0.txt | * Cloud Firestore integrations
* Use the Cloud Firestore REST API
* Use Cloud Firestore and Realtime Database
* Extend with Cloud Functions for Firebase (2nd gen)
* Extend with Cloud Functions
* Third-party library integrations | |
firebase/queries4_19_0.txt | * Storage
* ML | |
firebase/firestore_3_10.txt | rence
* [ Node.js 2nd gen ](/docs/reference/functions/2nd-gen/node/firebase-functions)
* [ Node.js 1st gen ](/docs/reference/functions/firebase-functions)
* [ Node.js Test SDK ](/docs/reference/functions/test/test)
* [ Python ](/docs/reference/functions/2nd-gen/python)
* [ Protocol s... | |
firebase/firestore-query-filter-compound-multi-eq5_26_0.txt | Query a Firestore collection with multiple eq filters
## Explore further | |
firebase/queries4_36_0.txt | * Flutter
* Get Started
* Manage Users
* Password Authentication
* Email Link Authentication
* Federated Identity & Social
* Phone Number
* Use a Custom Auth System
* Anonymous Authentication
* Multi-factor Auth
* Link Multiple Auth Providers
... | |
firebase/queries4_138_0.txt | * Learn
* Events
* Stories
* Add Firebase - Apple platforms (iOS+)
* Add Firebase - Android
* Add Firebase - Web
* Add Firebase - Flutter
* Add Firebase - C++
* Add Firebase - Unity
* Add Firebase - Server environments
* Manage Firebase projects
* Supported platforms & frameworks
... | |
firebase/queries4_142_0.txt | # Perform simple and compound queries in Cloud Firestore
Stay organized with collections Save and categorize content based on your
preferences. | |
firebase/multiple-range-fields5_119_0.txt | * Cloud Functions and Firebase
* Cloud Functions locations
* Quotas and limits
* Security Rules | |
firebase/firestore_1_6.txt | a)
* [ Save Data ](/docs/database/admin/save-data)
* [ Retrieve Data ](/docs/database/admin/retrieve-data)
* REST
* [ Get Started ](/docs/database/rest/start)
* [ Structure Data ](/docs/database/rest/structure-data)
* [ Save Data ](/docs/database/rest/save-data)
* [ Retri... | |
firebase/multiple-range-fields5_29_0.txt | * Google Ads
* App Indexing | |
firebase/performance_monitoring_1_5.txt |
plugins {
// To benefit from the latest Performance Monitoring plugin features,
// update your Android Gradle plugin dependency to at least v3.4.0
id 'com.android.application' version '7.3.0' apply false
// Make sure that you have the Google services Gradle plugin dep... | |
firebase/queries4_189_0.txt | ##### Objective-C
Note: This product is not available on watchOS and App Clip targets. | |
firebase/firestore_0_4.txt | * [ Move data between projects ](/docs/firestore/manage-data/move-data)
* Read data
* [ Get data ](/docs/firestore/query-data/get-data)
* [ Get real-time updates ](/docs/firestore/query-data/listen)
* [ Perform simple and compound queries ](/docs/firestore/query-data/queries)
* [ O... | |
firebase/multiple-range-fields5_42_0.txt | * Introduction
* Get started
* Understand Cloud Firestore
* Compare Cloud Firestore and Realtime Database
* Data model
* Data types
* SDKs and client libraries
* Index types
* Database locations
* Data bundles | |
firebase/queries4_149_0.txt |
let citiesRef = db.collection("cities")
citiesRef.document("SF").setData([
"name": "San Francisco",
"state": "CA",
"country": "USA",
"capital": false,
"population": 860000,
"regions": ["west_coast", "norcal"]
])
citiesRef.document("LA").setData([
... | |
firebase/firestore-query-filter-compound-multi-eq5_32_0.txt | To authenticate to Firestore, set up Application Default Credentials. For more
information, see Set up authentication for a local development environment .
Query chainedQuery1 = cities.whereEqualTo("state", "CO").whereEqualTo("name", "Denver"); | |
firebase/multiple-range-fields5_25_0.txt | Engage
* Analytics | |
firebase/queries4_70_0.txt | * Get Started
* Create a Reference
* Upload Files
* Download Files
* Use File Metadata
* Delete Files
* List Files
* Handle Errors
* Admin | |
firebase/multiple-range-fields5_73_0.txt | * Get Started
* Create a Reference
* Upload Files
* Download Files
* Use File Metadata
* Delete Files
* Handle Errors
* Security & Rules | |
firebase/firestore_3_15.txt | auth
firestore
}
* **Binary dependencies.** Similarly, the recommended way to get the binary dependencies is to add the following to your ` CMakeLists.txt ` file:
add_subdirectory(${FIREBASE_CPP_SDK_DIR} bin/ EXCL... | |
firebase/firestore-query-filter-compound-multi-eq5_31_0.txt |
denverQuery := cities.Where("name", "==", "Denver").Where("state", "==", "CO")
caliQuery := cities.Where("state", "==", "CA").Where("population", "<=", 1000000)
query := cities.Where("country", "==", "USA").Where("population", ">", 5000000)
### Java | |
firebase/queries4_483_0.txt |
final citiesRef = db.collection("cities");
final ggbData = {"name": "Golden Gate Bridge", "type": "bridge"};
citiesRef.doc("SF").collection("landmarks").add(ggbData);
final lohData = {"name": "Legion of Honor", "type": "museum"};
citiesRef.doc("SF").collection("landmarks").add(lo... | |
firebase/firestore_4_1.txt | lytics)
* [ Remote Config ](https://firebase.google.com/docs/remote-config)
* [ A/B Testing ](https://firebase.google.com/docs/ab-testing)
* [ Cloud Messaging ](https://firebase.google.com/docs/cloud-messaging)
* [ In-App Messaging ](https://firebase.google.com/docs/in-app-messaging)
* [ Dynamic Links ](... | |
firebase/multiple-range-fields5_96_0.txt | * Detect and track objects
* Overview
* iOS
* Android | |
firebase/queries4_15_0.txt | * Supported platforms & frameworks
* Use Emulator Suite | |
firebase/firestore-data-filter-by-date-android-java9_65_0.txt | * Questions
* Help
##### Products | |
firebase/queries4_380_0.txt | Note: This product is not available on watchOS and App Clip targets.
[[citiesRef queryWhereField:@"state" isEqualTo:@"CO"]
queryWhereField:@"name" isGreaterThanOrEqualTo:@"Denver"];
[[citiesRef queryWhereField:@"state" isEqualTo:@"CA"]
queryWhereField:@"population" isLessThan:@100000... | |
firebase/queries4_342_0.txt | ##### Python
cities_ref = db.collection("cities")
query = cities_ref.where(
filter=FieldFilter(
"regions", "array_contains_any", ["west_coast", "east_coast"]
)
)
return query
snippets.py | |
firebase/queries4_443_0.txt | ##### Python
from google.cloud import firestore
from google.cloud.firestore_v1.base_query import FieldFilter, Or
def query_or_composite_filter(project_id: str) -> None:
# Instantiate the Firestore client
client = firestore.Client(project=project_id)
col_ref = cl... | |
firebase/queries4_469_0.txt | ##### C#
Snippet not available. | |
firebase/queries4_408_0.txt | ##### Node.js
citiesRef.where('state', '>=', 'CA').where('state', '<=', 'IN');
citiesRef.where('state', '==', 'CA').where('population', '>', 1000000);
index.js | |
firebase/queries4_120_0.txt | * Introduction
* Get started
* Understand Security Rules
* Security Rules language
* How Security Rules work
* Security Rules and Firebase Authentication | |
firebase/queries4_218_0.txt |
const citiesRef = db.collection('cities');
const snapshot = await citiesRef.where('capital', '==', true).get();
if (snapshot.empty) {
console.log('No matching documents.');
return;
}
snapshot.forEach(doc => {
console.log(doc.id, '=>', doc.data());
});
... | |
firebase/firestore-data-filter-by-date-android-java9_42_0.txt | arun arun
358 2 2 silver badges 13 13 bronze badges | |
firebase/multiple-range-fields5_12_0.txt | * Add Firebase - Web
* Add Firebase - Flutter | |
firebase/multiple-range-fields5_162_0.txt | ### Java
db.collection("employees")
.whereGreaterThan("salary", 100000)
.orderBy("salary")
.get()
.addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {
@Override
public void onSuccess(QuerySnapshot queryDocumentSnapshots) {
// Order ... | |
firebase/queries4_273_0.txt | ##### Swift
Note: This product is not available on watchOS and App Clip targets. | |
firebase/queries4_169_0.txt |
// Create a reference to the cities collection
let citiesRef = db.collection("cities")
// Create a query against the collection.
let query = citiesRef.whereField("state", isEqualTo: "CA")
ViewController.swift
##### Objective-C | |
firebase/queries4_145_0.txt | ### Web modular API
Learn more about the tree-shakeable modular Web API and upgrade from the
namespaced API. | |
firebase/queries4_197_0.txt |
Query capital_cities = db->Collection("cities").WhereEqualTo(
"capital", FieldValue::Boolean(true));
snippets.cpp
##### Node.js | |
firebase/multiple-range-fields5_19_0.txt | * Storage
* ML | |
firebase/queries4_160_0.txt | ##### PHP
$citiesRef = $db->collection('samples/php/cities');
$citiesRef->document('SF')->set([
'name' => 'San Francisco',
'state' => 'CA',
'country' => 'USA',
'capital' => false,
'population' => 860000,
'regions' => ['west_coast', 'norcal']
]);
... | |
firebase/queries4_369_0.txt | ##### Unity
Query query = citiesRef.WhereIn(new FieldPath("regions"), new List<string>{"west_coast", "east_coast"}); | |
firebase/queries4_358_0.txt | Note: This product is not available on watchOS and App Clip targets.
[citiesRef queryWhereField:@"regions" in:@[@[@"west_coast"], @[@"east_coast"]]];
ViewController.m | |
firebase/queries4_303_0.txt | ##### C++
CollectionReference cities_ref = db->Collection("cities");
cities_ref.WhereIn("country", std::vector<FieldValue> {
FieldValue::String("USA"),
FieldValue::String("Japan")
});
snippets.cpp | |
firebase/firestore_2_13.txt | ot supported natively.** You can build on Realtime Database's support for presence by syncing Cloud Firestore and Realtime Database using Cloud Functions See [ Build presence in Cloud Firestore ](https://firebase.google.com/docs/firestore/solutions/presence) . | **Presence supported.**
### Querying
Retrieve, s... | |
firebase/queries4_269_0.txt | ### Array membership
You can use the ` array-contains ` operator to filter based on array values.
For example: | |
firebase/queries4_366_0.txt | ##### Node.js
const exactlyOneCoast = await citiesRef.where('regions', 'in',
[['west_coast', 'east_coast']]).get();
index.js | |
firebase/queries4_151_0.txt | ### Kotlin+KTX
val cities = db.collection("cities")
val data1 = hashMapOf(
"name" to "San Francisco",
"state" to "CA",
"country" to "USA",
"capital" to false,
"population" to 860000,
"regions" to listOf("west_coast", "norcal"),
)
cities.do... | |
firebase/multiple-range-fields5_13_0.txt | * Add Firebase - C++
* Add Firebase - Unity | |
firebase/queries4_0_0.txt | *
Products | |
firebase/queries4_456_0.txt |
let query = db.collection("cities").whereFilter(Filter.andFilter([
Filter.whereField("state", isEqualTo: "CA"),
Filter.orFilter([
Filter.whereField("capital", isEqualTo: true),
Filter.whereField("population", isGreaterThanOrEqualTo: 1000000);
])
]))
... | |
firebase/queries4_500_0.txt |
[[[self.db collectionGroupWithID:@"landmarks"] queryWhereField:@"type" isEqualTo:@"museum"]
getDocumentsWithCompletion:^(FIRQuerySnapshot *snapshot, NSError *error) {
// ...
}];
ViewController.m
### Kotlin+KTX | |
firebase/queries4_225_0.txt | ## Query operators
The ` where() ` method takes three parameters: a field to filter on, a
comparison operator, and a value. Cloud Firestore supports the following
comparison operators: | |
firebase/queries4_434_0.txt | ## ` OR ` queries
You can combine constraints with a logical ` OR ` . For example: | |
firebase/multiple-range-fields5_5_0.txt | * Engage
* Reference | |
firebase/multiple-range-fields5_107_0.txt | * Prepare for Production
* Reduce app package size | |
firebase/queries4_248_0.txt | Learn more about the tree-shakeable modular Web API and upgrade from the
namespaced API.
const notCapitalQuery = query(citiesRef, where("capital", "!=", false));
simple_query_not_equal.js | |
firebase/queries4_188_0.txt | Note: This product is not available on watchOS and App Clip targets.
let capitalCities = db.collection("cities").whereField("capital", isEqualTo: true)
ViewController.swift | |
firebase/queries4_382_0.txt | ### Java
citiesRef.whereEqualTo("state", "CO").whereEqualTo("name", "Denver");
citiesRef.whereEqualTo("state", "CA").whereLessThan("population", 1000000);
DocSnippets.java | |
firebase/queries4_22_0.txt | * Extensions
Release & Monitor | |
firebase/multiple-range-fields5_85_0.txt | * Cloud AutoML Vision Edge (deprecated)
* Overview
* Train image labeling models
* Label images with your models | |
firebase/queries4_376_0.txt |
import { query, where } from "firebase/firestore";
const q1 = query(citiesRef, where("state", "==", "CO"), where("name", "==", "Denver"));
const q2 = query(citiesRef, where("state", "==", "CA"), where("population", "<", 1000000));
chain_filters.js
### Web namespaced API | |
firebase/queries4_385_0.txt | ##### Python
cities_ref = db.collection("cities")
denver_query = cities_ref.where(filter=FieldFilter("state", "==", "CO")).where(
filter=FieldFilter("name", "==", "Denver")
)
large_us_cities_query = cities_ref.where(
filter=FieldFilter("state", "==", "CA")
).where(fi... | |
firebase/multiple-range-fields5_91_0.txt | * ML Kit for Firebase
* Introduction
* Vision | |
firebase/multiple-range-fields5_17_0.txt | * Emulator Suite
* Authentication | |
firebase/multiple-range-fields5_4_0.txt | * Build
* Release & Monitor | |
firebase/queries4_185_0.txt | Learn more about the tree-shakeable modular Web API and upgrade from the
namespaced API.
import { collection, query, where } from "firebase/firestore";
const citiesRef = collection(db, "cities");
const q = query(citiesRef, where("capital", "==", true));
simple_queries_again.js | |
firebase/queries4_52_0.txt | * Cloud Firestore integrations
* Use the Cloud Firestore REST API
* Use Cloud Firestore and Realtime Database
* Extend with Cloud Functions for Firebase (2nd gen)
* Extend with Cloud Functions
* Third-party library integrations | |
firebase/queries4_350_0.txt | ##### Ruby
cities_ref = firestore.col collection_path
costal_cities = cities_ref.where "regions", "array-contains-any", ["west_coast", "east_coast"]
query_data.rb | |
firebase/queries4_162_0.txt | ##### C#
CollectionReference citiesRef = db.Collection("cities");
await citiesRef.Document("SF").SetAsync(new Dictionary<string, object>(){
{ "Name", "San Francisco" },
{ "State", "CA" },
{ "Country", "USA" },
{ "Capital", false },
{ "Population", 860000 },
... | |
firebase/queries4_499_0.txt | ##### Objective-C
Note: This product is not available on watchOS and App Clip targets. | |
firebase/queries4_471_0.txt | ### Limitations
Note the following limitations for ` or ` queries: | |
firebase/queries4_147_0.txt | Learn more about the tree-shakeable modular Web API and upgrade from the
namespaced API.
var citiesRef = db.collection("cities");
citiesRef.doc("SF").set({
name: "San Francisco", state: "CA", country: "USA",
capital: false, population: 860000,
regions: ["west_coast", "... | |
firebase/queries4_405_0.txt | ##### Python
cities_ref = db.collection("cities")
cities_ref.where(filter=FieldFilter("state", ">=", "CA")).where(
filter=FieldFilter("state", "<=", "IN")
)
snippets.py | |
firebase/queries4_472_0.txt | * Cloud Firestore limits a query to a maximum of 30 disjunctions based on the query's disjunctive normal form . You are more likely to reach this limit when performing an ` AND ` of multiple ` OR ` groups.
* You can't combine ` not-in ` with ` in ` , ` array-contains-any ` , or ` or ` in the same query.
For a ... | |
firebase/queries4_17_0.txt | * Emulator Suite
* Authentication | |
firebase/multiple-range-fields5_75_0.txt | * Machine Learning
* Introduction
* Codelabs
* Custom Models | |
firebase/queries4_451_0.txt | ##### Ruby
Snippet not available. | |
firebase/queries4_475_0.txt | Learn more about the tree-shakeable modular Web API and upgrade from the
namespaced API.
import { collection, addDoc } from "firebase/firestore";
const citiesRef = collection(db, 'cities');
await Promise.all([
addDoc(collection(citiesRef, 'SF', 'landmarks'), {
n... | |
firebase/multiple-range-fields5_53_0.txt | * API reference
* Android
* Swift
* Objective-C
* Web
* Flutter
* Cloud Functions
* Node.js
* Java
* Python
* Go
* C#
* PHP
* Ruby
* C++
* Unity
* REST
* RPC | |
firebase/queries4_105_0.txt | * iOS
* Android
* Advanced Topics | |
firebase/queries4_290_0.txt | ### ` in ` , ` not-in ` , and ` array-contains-any `
Use the ` in ` operator to combine up to 30 equality ( ` == ` ) clauses on
the same field with a logical ` OR ` . An ` in ` query returns documents where
the given field matches any of the comparison values. For example: | |
firebase/queries4_504_0.txt |
final Query museums = db.collectionGroup("landmarks").whereEqualTo("type", "museum");
final ApiFuture<QuerySnapshot> querySnapshot = museums.get();
for (DocumentSnapshot document : querySnapshot.get().getDocuments()) {
System.out.println(document.getId());
}
QueryDataSnippets.ja... | |
firebase/multiple-range-fields5_2_0.txt | * Engage
Solutions Pricing Docs | |
firebase/queries4_441_0.txt | ### Dart
var query = db.collection("cities")
.where(
Filter.or(
Filter("capital", isEqualTo: true),
Filter("population", isGreaterThan: 1000000)
));
firestore.dart | |
firebase/multiple-range-fields5_26_0.txt | * Remote Config
* A/B Testing | |
firebase/queries4_412_0.txt | ##### C#
CollectionReference citiesRef = db.Collection("cities");
Query rangeQuery = citiesRef
.WhereGreaterThanOrEqualTo("State", "CA")
.WhereLessThanOrEqualTo("State", "IN");
Program.cs | |
firebase/queries4_396_0.txt |
import { query, where } from "firebase/firestore";
const q1 = query(citiesRef, where("state", ">=", "CA"), where("state", "<=", "IN"));
const q2 = query(citiesRef, where("state", "==", "CA"), where("population", ">", 1000000));
valid_range_filters.js
### Web namespaced API | |
firebase/queries4_527_0.txt | | 10
query(collectionRef,
and( where("a", "in", [1, 2, 3, 4, 5]),
where("b", "in", [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
)
)
| 50 This query returns an error, because it surpasses the limit of 30
disjunctions.
query(collect... | |
firebase/queries4_30_0.txt | Reference Samples
* | |
firebase/multiple-range-fields5_108_0.txt | * Android
* Protect your Cloud credentials | |
firebase/queries4_86_0.txt | * iOS+
* Android
* Train object detection models
* Detect objects with your models | |
firebase/queries4_115_0.txt | * Write functions
* Manage deployment and runtime options
* Write functions in TypeScript
* Sync, async, and promises
* Retry asynchronous functions
* Configure your environment
* Organize functions
* Handling dependencies
* Optimizing networking
* Tip... | |
firebase/queries4_515_0.txt | Cloud Firestore allows you to measure performance of your queries on the
backend and receive detailed performance statistics on backend query execution
in return.
Query Explain results help you understand how your queries are executed,
showing you inefficiencies and the location of likely server-side bottlenecks. | |
firebase/queries4_410_0.txt | ##### PHP
$rangeQuery = $citiesRef
->where('state', '>=', 'CA')
->where('state', '<=', 'IN');
query_filter_range_valid.php | |
firebase/queries4_91_0.txt | * ML Kit for Firebase
* Introduction
* Vision |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.