id stringlengths 16 145 | text stringlengths 1 179k | title stringclasses 1
value |
|---|---|---|
firebase/queries4_247_0.txt | Use the not equal ( ` != ` ) operator to return documents where the given
field exists and does not match the comparison value. For example:
### Web modular API | |
firebase/queries4_299_0.txt | ### Dart
final citiesRef = db.collection("cities");
final cities = citiesRef.where("country", whereIn: ["USA", "Japan"]);
firestore.dart | |
firebase/queries4_351_0.txt | This query returns every city document where the ` regions ` field is an array
that contains ` west_coast ` or ` east_coast ` . From the example data, this
includes the ` SF ` , ` LA ` , and ` DC ` documents.
Results from ` array-contains-any ` are de-duped. Even if a document's array
field matches more than one of th... | |
firebase/queries4_295_0.txt |
let citiesRef = db.collection("cities")
citiesRef.whereField("country", in: ["USA", "Japan"])
ViewController.swift
##### Objective-C | |
firebase/firestore_4_5.txt | * [ Work with point-in-time recovery (PITR) ](/docs/firestore/use-pitr)
* Techniques and best practices
* [ Best practices for Cloud Firestore ](/docs/firestore/best-practices)
* [ Map data with Swift Codable ](/docs/firestore/solutions/swift-codable-data-mapping)
* [ Understand reads and wr... | |
firebase/firestore-query-filter-compound-multi-eq5_12_0.txt | * Google Cloud Home
* Free Trial and Free Tier | |
firebase/firestore_3_6.txt | ocs/database/flutter/offline-capabilities)
* Admin
* [ Get Started ](/docs/database/admin/start)
* [ Structure Data ](/docs/database/admin/structure-data)
* [ Save Data ](/docs/database/admin/save-data)
* [ Retrieve Data ](/docs/database/admin/retrieve-data)
* REST
* [ Ge... | |
firebase/firestore-data-filter-by-date-android-java9_58_0.txt | What are the differences between a HashMap and a Hashtable in Java?
4103 | |
firebase/queries4_467_0.txt | ##### PHP
Snippet not available. | |
firebase/queries4_139_0.txt | * Emulator Suite
* Authentication
* Realtime Database
* Firestore
* Storage
* ML
* Hosting
* Cloud Functions
* Security Rules
* App Check
* Extensions
* Crashlytics
* Performance Monitoring
* Test Lab
* App Distribution | |
firebase/multiple-range-fields5_118_0.txt | * API Reference
* Node.js 2nd gen
* Node.js 1st gen
* Node.js Test SDK
* Python
* Protocol specification for https.onCall | |
firebase/queries4_402_0.txt | ### Java
citiesRef.whereGreaterThanOrEqualTo("state", "CA")
.whereLessThanOrEqualTo("state", "IN");
citiesRef.whereEqualTo("state", "CA")
.whereGreaterThan("population", 1000000);
DocSnippets.java | |
firebase/queries4_481_0.txt |
val citiesRef = db.collection("cities")
val ggbData = mapOf(
"name" to "Golden Gate Bridge",
"type" to "bridge",
)
citiesRef.document("SF").collection("landmarks").add(ggbData)
val lohData = mapOf(
"name" to "Legion of Honor",
"type" to "museum",
... | |
firebase/queries4_20_0.txt | * Hosting
* Cloud Functions | |
firebase/firestore_4_0.txt | [ 
](/)
*
[ Products ](https://firebase.google.com/products-build)
* [ Build ](https://firebase.google.com/products-build)
* [ Release & Monitor ](https://fir... | |
firebase/queries4_372_0.txt | This query returns every city document where the ` regions ` field is an array
that contains exactly one element of either ` west_coast ` or ` east_coast ` .
From the example data, only the ` DC ` document qualifies with its ` regions `
field of ` ["east_coast"] ` . The ` SF ` document, however, does not match
because ... | |
firebase/queries4_415_0.txt | Learn more about the tree-shakeable modular Web API and upgrade from the
namespaced API.
import { query, where } from "firebase/firestore";
const q = query(citiesRef, where("state", ">=", "CA"), where("population", ">", 100000));
invalid_range_filters.js | |
firebase/firestore_3_27.txt | m/google/example/firestore/kotlin/DocSnippets.kt#L179-L188)
### Java
db.collection("users")
.get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
... | |
firebase/queries4_449_0.txt | ##### Unity
Query query = citiesRef.Where(Filter.Or(
Filter.EqualTo("State", "CA"),
Filter.GreaterThanOrEqualTo("population", 1000000)
));
query.GetSnapshotAsync().ContinueWithOnMainThread((querySnapshotTask) =>
{
foreach (DocumentSnapshot documentSnapshot in ... | |
firebase/firestore-query-filter-compound-multi-eq5_37_0.txt |
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(filter=FieldFilte... | |
firebase/queries4_409_0.txt | ##### Go
stateQuery := cities.Where("state", ">=", "CA").Where("state", "<", "IN")
populationQuery := cities.Where("state", "==", "CA").Where("population", ">", 1000000)
query.go | |
firebase/multiple-range-fields5_30_0.txt | Reference Samples
* | |
firebase/firestore_3_30.txt | [ Release notes ](/support/releases)
* [ FAQs ](/support/faq/)
[  ](https://developers.google.com/)
* [ Android ](//developer.andr... | |
firebase/firestore_4_14.txt | havior.
First wrap the function you'd like to test. Let's say you have a function in `
functions/index.js ` called ` makeUppercase ` , which you'd like to test.
Write the following in ` functions/test/index.test.js `
// "Wrap" the makeUpperCase function from index.js
const myFunctions = require('..... | |
firebase/multiple-range-fields5_72_0.txt | * Get Started
* Create a Reference
* Upload Files
* Download Files
* Use File Metadata
* Delete Files
* Handle Errors
* Unity | |
firebase/firestore-data-filter-by-date-android-java9_1_0.txt | 1. About
2. Products
3. For Teams
1. Stack Overflow Public questions & answers
2. Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
3. Talent Build your employer brand
4. Advertising Reach developers & technologists worldwide
5. Labs The future... | |
firebase/queries4_418_0.txt | Note: This product is not available on watchOS and App Clip targets.
Note: This product is not available on watchOS and App Clip targets. | |
firebase/queries4_210_0.txt |
[[[self.db collectionWithPath:@"cities"] queryWhereField:@"capital" isEqualTo:@(YES)]
getDocumentsWithCompletion:^(FIRQuerySnapshot *snapshot, NSError *error) {
if (error != nil) {
NSLog(@"Error getting documents: %@", error);
} else {
for (FIRDocumentSn... | |
firebase/queries4_327_0.txt |
Query query = citiesRef.WhereNotIn(new FieldPath("country"), new List<string>{"USA", "Japan"});
Query query = citiesRef.WhereNotIn("country", new List<object>(){"USA", "Japan"});
##### C# | |
firebase/performance_monitoring_3_4.txt | segment data by game level.
### Default attributes collected for web apps
All traces for web apps collect the following attributes by default:
* Browser
* Country
* [ Effective connection type ](//developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/effectiveType)
* Page URL
* Service worker sta... | |
firebase/queries4_314_0.txt |
citiesRef.where('country', 'not-in', ['USA', 'Japan']);
test.firestore.js
##### Swift | |
firebase/queries4_521_0.txt | ` A and (B and C) => A and B and C `
* Distributive Law | |
firebase/queries4_362_0.txt | ##### Java
CollectionReference citiesRef = db.collection("cities");
Query query =
citiesRef.whereIn(
"regions", Arrays.asList(Arrays.asList("west_coast"), Arrays.asList("east_coast")));
QueryDataSnippets.java | |
firebase/queries4_459_0.txt | ### Java
Query query = collection.where(Filter.and(
Filter.equalTo("state", "CA"),
Filter.or(
Filter.equalTo("capital", true),
Filter.greaterThanOrEqualTo("population", 1000000)
)
));
DocSnippets.java | |
firebase/multiple-range-fields5_51_0.txt | * Techniques and best practices
* Best practices for Cloud Firestore
* Map data with Swift Codable
* Understand reads and writes at scale
* Understand real-time queries at scale | |
firebase/queries4_72_0.txt | * Get Started
* Create a Reference
* Upload Files
* Download Files
* Use File Metadata
* Delete Files
* Handle Errors
* Unity | |
firebase/multiple-range-fields5_129_0.txt | * Send tokens from the client
* iOS+
* Android
* Web
* Flutter
* C++
* Unity | |
firebase/firestore-data-filter-by-date-android-java9_46_0.txt | Google Cloud Collective Join the discussion
This question is in a collective: a subcommunity defined by tags with
relevant content and experts. | |
firebase/firestore_0_8.txt | ](/docs/ml/ios/ab-test-models)
* [ Android ](/docs/ml/android/ab-test-models)
* Prepare for Production
* Protect your Cloud credentials
* [ iOS+ ](/docs/ml/ios/secure-api-key)
* [ Android ](/docs/ml/android/secure-api-key)
* Legacy Documentation
* ML Kit for Firebase
... | |
firebase/queries4_453_0.txt | ### Web modular API
const q = query(collection(db, "cities"), and(
where('state', '==', 'CA'),
or(
where('capital', '==', true),
where('population', '>=', 1000000)
)
));
test.firestore.js | |
firebase/queries4_202_0.txt |
CollectionReference citiesRef = db.Collection("cities");
Query query = citiesRef.WhereEqualTo("Capital", true);
QuerySnapshot querySnapshot = await query.GetSnapshotAsync();
foreach (DocumentSnapshot documentSnapshot in querySnapshot.Documents)
{
Console.WriteLine("Document {0} ret... | |
firebase/queries4_524_0.txt | The following examples show the number of disjunctions for different queries:
Query | Number of disjunctions
---|---
query(collectionRef, where("a", "==", 1))
| |
firebase/queries4_228_0.txt | Learn more about the tree-shakeable modular Web API and upgrade from the
namespaced API.
const stateQuery = query(citiesRef, where("state", "==", "CA"));
const populationQuery = query(citiesRef, where("population", "<", 100000));
const nameQuery = query(citiesRef, where("name", ">=", "San Fran... | |
firebase/queries4_190_0.txt |
FIRQuery *capitalCities =
[[self.db collectionWithPath:@"cities"] queryWhereField:@"capital" isEqualTo:@YES];
ViewController.m
### Kotlin+KTX | |
firebase/queries4_429_0.txt | ##### Go
query := cities.Where("state", ">=", "CA").Where("population", ">", 1000000)
query.go | |
firebase/multiple-range-fields5_22_0.txt | * Extensions
Release & Monitor | |
firebase/queries4_466_0.txt | ##### Go
Snippet not available. | |
firebase/firestore-data-filter-by-date-android-java9_11_0.txt | 10. Communities for your favorite technologies. Explore all Collectives
2. Teams | |
firebase/queries4_61_0.txt | * Get Started
* Structure Data
* Save Data
* Retrieve Data
* Authenticate REST Requests
* C++ | |
firebase/multiple-range-fields5_174_0.txt | * Terms
* Privacy
* Manage cookies
* English
* Español – América Latina
* Indonesia
* Português – Brasil
* Русский
* فارسی
* বাংলা
* 中文 – 简体
* 日本語
* 한국어 | |
firebase/queries4_270_0.txt | ### Web modular API
Learn more about the tree-shakeable modular Web API and upgrade from the
namespaced API. | |
firebase/firestore_3_7.txt | ](/docs/storage/flutter/upload-files)
* [ Download Files ](/docs/storage/flutter/download-files)
* [ Use File Metadata ](/docs/storage/flutter/file-metadata)
* [ Delete Files ](/docs/storage/flutter/delete-files)
* [ List Files ](/docs/storage/flutter/list-files)
* [ Handle Errors ](... | |
firebase/performance_monitoring_1_0.txt | [ 
](/)
*
[ Products ](https://firebase.google.com/products-build)
* [ Build ](https://firebase.google.com/products-build)
* [ Release & Monitor ](https://fir... | |
firebase/queries4_135_0.txt | * Resize Images
* Export Collections to BigQuery
* Translate Text
* Distributed Counter
* Shorten URLs
* Limit Child Nodes
* Build & publish extensions
* Overview
* Get started
* * Write functions
* Set up parameters
* Handle lifecycle events
* Add us... | |
firebase/queries4_217_0.txt |
db->Collection("cities")
.WhereEqualTo("capital", FieldValue::Boolean(true))
.Get()
.OnCompletion([](const Future<QuerySnapshot>& future) {
if (future.error() == Error::kErrorOk) {
for (const DocumentSnapshot& document :
future.result()->docum... | |
firebase/multiple-range-fields5_153_0.txt | In Cloud Firestore, the ` ORDER BY ` clause of a query determines which
indexes can be used to serve the query. For example, an ` ORDER BY a ASC, b
ASC ` query requires a composite index on the ` a ASC, b ASC ` fields.
To optimize the performance and cost of Cloud Firestore queries, you should
optimize the order of fi... | |
firebase/queries4_490_0.txt |
$citiesRef = $db->collection('samples/php/cities');
$citiesRef->document('SF')->collection('landmarks')->newDocument()->set([
'name' => 'Golden Gate Bridge',
'type' => 'bridge'
]);
$citiesRef->document('SF')->collection('landmarks')->newDocument()->set([
'name' => 'Legi... | |
firebase/performance_monitoring_3_0.txt | [ 
](/)
*
[ Products ](https://firebase.google.com/products-build)
* [ Build ](https://firebase.google.com/products-build)
* [ Release & Monitor ](https://fir... | |
firebase/queries4_10_0.txt | * Documentation
* Firestore
Overview Fundamentals | |
firebase/queries4_208_0.txt | Note: This product is not available on watchOS and App Clip targets.
do {
let querySnapshot = try await db.collection("cities").whereField("capital", isEqualTo: true)
.getDocuments()
for document in querySnapshot.documents {
print("\(document.documentID) => \(document.data())... | |
firebase/queries4_245_0.txt |
CollectionReference citiesRef = db.Collection("cities");
Query stateQuery = citiesRef.WhereEqualTo("State", "CA");
Query populationQuery = citiesRef.WhereGreaterThan("Population", 1000000);
Query nameQuery = citiesRef.WhereGreaterThanOrEqualTo("Name", "San Francisco");
Program.cs
###... | |
firebase/queries4_318_0.txt |
citiesRef.whereNotIn("country", listOf("USA", "Japan"))
DocSnippets.kt
### Java | |
firebase/firestore_3_18.txt |
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
// Use a service account
InputStream serviceAccount = new FileInputStream("path/to/serviceAccount.json");
GoogleCredentials credentials = GoogleCredentials.fromStream(serviceAccount);
FirebaseOptions op... | |
firebase/multiple-range-fields5_149_0.txt | ### Kotlin+KTX Android
val query = db.collection("users")
.whereGreaterThan("age", 35)
.whereGreaterThan("height", 60)
.whereLessThan("height", 70)
| |
firebase/queries4_464_0.txt | ##### C++
Snippet not available. | |
firebase/queries4_319_0.txt |
citiesRef.whereNotIn("country", Arrays.asList("USA", "Japan"));
DocSnippets.java
### Dart | |
firebase/queries4_310_0.txt | This query returns every ` city ` document where the ` country ` field is set
to ` USA ` or ` Japan ` . From the example data, this includes the ` SF ` , `
LA ` , ` DC ` , and ` TOK ` documents.
#### ` not-in ` | |
firebase/queries4_282_0.txt | ##### C++
CollectionReference cities_ref = db->Collection("cities");
cities_ref.WhereArrayContains("region", FieldValue::String("west_coast"));
snippets.cpp | |
firebase/multiple-range-fields5_0_0.txt | *
Products | |
firebase/firestore_4_6.txt | ](/docs/database/flutter/offline-capabilities)
* Admin
* [ Get Started ](/docs/database/admin/start)
* [ Structure Data ](/docs/database/admin/structure-data)
* [ Save Data ](/docs/database/admin/save-data)
* [ Retrieve Data ](/docs/database/admin/retrieve-data)
* REST
... | |
firebase/queries4_68_0.txt | * Get Started
* Create a Reference
* Upload Files
* Download Files
* Use File Metadata
* Delete Files
* List Files
* Handle Errors
* Web | |
firebase/firestore-data-filter-by-date-android-java9_28_0.txt | edited Dec 26, 2021 at 22:03
MyNameIsCaleb | |
firebase/queries4_106_0.txt | * A/B test two versions of a model
* iOS
* Android | |
firebase/queries4_112_0.txt | * Manage live & preview channels, releases, and versions
* Monitor web request data with Cloud Logging
* Usage, quotas, and pricing
* Deploy using the REST API
* Cloud Functions | |
firebase/firestore-query-filter-compound-multi-eq5_8_0.txt | close
* Access and resources management | |
firebase/firestore_3_24.txt | born": 1912
])
print("Document added with ID: \(ref.documentID)")
} catch {
print("Error adding document: \(error)")
}
[ViewController.swift](https://github.com/firebase/snippets-ios/blob/28419063c1cdf4970fb6104f3c86f1037ac24ad0/firestore/swift/firestore-smoketest/ViewController.swift... | |
firebase/queries4_349_0.txt | ##### C#
CollectionReference citiesRef = db.Collection("cities");
Query query = citiesRef.WhereArrayContainsAny("Regions", new[] { "west_coast", "east_coast" });
Program.cs | |
firebase/queries4_497_0.txt |
var museums = db.collectionGroup('landmarks').where('type', '==', 'museum');
museums.get().then((querySnapshot) => {
querySnapshot.forEach((doc) => {
console.log(doc.id, ' => ', doc.data());
});
});
test.firestore.js
##### Swift | |
firebase/firestore-query-filter-compound-multi-eq5_29_0.txt | To authenticate to Firestore, set up Application Default Credentials. For more
information, see Set up authentication for a local development environment .
CollectionReference citiesRef = db.Collection("cities");
Query chainedQuery = citiesRef
.WhereEqualTo("State", "CA")
.WhereEqua... | |
firebase/firestore-query-filter-compound-multi-eq5_9_0.txt | * Cloud SDK, languages, frameworks, and tools
* Costs and usage management | |
firebase/queries4_367_0.txt | ##### Go
cities := client.Collection("cities")
query := cities.Where("regions", "in", [][]string{{"west_coast"}, {"east_coast"}}).Documents(ctx)
query.go | |
firebase/queries4_195_0.txt |
cities_ref = db.collection("cities")
query = cities_ref.where(filter=FieldFilter("capital", "==", True))
snippets.py
### Python | |
firebase/queries4_479_0.txt | ##### Objective-C
Note: This product is not available on watchOS and App Clip targets. | |
firebase/queries4_505_0.txt |
museums = db.collection_group("landmarks").where(
filter=FieldFilter("type", "==", "museum")
)
docs = museums.stream()
for doc in docs:
print(f"{doc.id} => {doc.to_dict()}")
snippets.py
### Python | |
firebase/queries4_123_0.txt | * Manage and deploy Security Rules
* App Check | |
firebase/firestore-query-filter-compound-multi-eq5_25_0.txt | # Query a Firestore collection with multiple eq filters
Stay organized with collections Save and categorize content based on your
preferences. | |
firebase/queries4_199_0.txt |
query := client.Collection("cities").Where("capital", "==", true)
query.go
##### PHP | |
firebase/queries4_143_0.txt | Cloud Firestore provides powerful query functionality for specifying which
documents you want to retrieve from a collection or collection group. These
queries can also be used with either ` get() ` or ` addSnapshotListener() ` ,
as described in Get Data and Get Realtime Updates .
Note: While the code samples cove... | |
firebase/firestore-query-filter-compound-multi-eq5_4_0.txt | * Databases
* Distributed, hybrid, and multicloud | |
firebase/queries4_177_0.txt | ##### C++
CollectionReference cities_ref = db->Collection("cities");
// Create a query against the collection.
Query query_ca =
cities_ref.WhereEqualTo("state", FieldValue::String("CA"));
snippets.cpp | |
firebase/firestore-query-filter-compound-multi-eq5_30_0.txt | ### Go
To authenticate to Firestore, set up Application Default Credentials. For more
information, see Set up authentication for a local development environment . | |
firebase/queries4_378_0.txt | ##### Swift
Note: This product is not available on watchOS and App Clip targets. | |
firebase/firestore-query-filter-compound-multi-eq5_42_0.txt | * Google Cloud pricing
* Google Workspace pricing
* See all products
* ### Solutions
* Infrastructure modernization
* Databases
* Application modernization
* Smart analytics
* Artificial Intelligence
* Security
* Productivity & work transformation
* Industry so... | |
firebase/multiple-range-fields5_130_0.txt | * Verify tokens on the backend
* Extensions | |
firebase/firestore-data-filter-by-date-android-java9_6_0.txt | company blog
2. 3. Log in
4. Sign up | |
firebase/queries4_286_0.txt | ##### Unity
CollectionReference citiesRef = db.Collection("cities");
Query arrayContainsQuery = citiesRef.WhereArrayContains("region", "west_coast");
| |
firebase/firestore-data-filter-by-date-android-java9_61_0.txt | Why is the Android emulator so slow? How can we speed up the Android emulator?
3984 | |
firebase/queries4_44_0.txt | * Read data
* Get data
* Get real-time updates
* Perform simple and compound queries
* Order and limit data
* Query with range & inequality filters on multiple fields | |
firebase/firestore-data-filter-by-date-android-java9_7_0.txt | 1. 1. Home
2. Questions | |
firebase/firestore_4_10.txt | I Reference
* [ 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)
* [ Prot... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.