42,780 questions
0
votes
0
answers
63
views
Firebase Cloud Functions won't allow Firebase Admin SDK to find collection, Error 5 NOT_FOUND [closed]
signupWithAccessCode.js:
const functions = require("firebase-functions/v2");
const {onRequest, onCall, HttpsError} = require("firebase-functions/https");
const admin = require(&...
1
vote
0
answers
54
views
Not able to save document using React Native 0.81.4 & firebase
I am using react-native 0.81.4 CLI along with the following Firebase packages:
"@react-native-firebase/app": "^23.5.0",
"@react-native-firebase/firestore": "^23.5.0&...
0
votes
0
answers
27
views
Getting Trending Items from FireStore [duplicate]
I am trying to use firestore and get a top list of items saved into the database. I want for example the top newest, top most worn, and top trending.
An item in the datastore looks something like this....
0
votes
2
answers
111
views
Cannot connect to Firestore from Flutter project (Android)
I'm using Flutter in Visual Studio Code and Android Studio with a Pixel 6a emulator with Android 13 to preview the app.
Despite I could connect to other services of Firebase (Authentication, Storage, ...
0
votes
0
answers
78
views
Failed to get FirebaseApp Instance in Xcode Preview after Modularization
Upon moving a view and it's ViewModel(where i am using Firestore) from the main app module to it's own module, my Canvas Previews crash with the error:
XCPreviewAgent crashed due to an uncaught ...
0
votes
2
answers
180
views
Why does a decoded Date from Firebase have a small milliseconds offset in Swift?
I’m fetching a Date stored in Firebase (Firestore or Storage metadata) and decoding it in Swift, but I noticed the resulting value isn’t exactly what I expect.
// The date is created for midnight (00:...
0
votes
1
answer
90
views
Firebase: Fetching documents from a database that is not default, but is still in the same project
I've been trying to fetch documents from a different database I made on my project. I have my primary database which is called 'Default' and I have another database in the same project called 'Staging'...
0
votes
1
answer
46
views
Rules for checking document key existence in Firestore
So I have a document for an event. Here's the current structure:
{
"name": "Some Event Name",
"users" : {
"a": {
"name": "Some Name&...
0
votes
1
answer
48
views
Firestore security rules: allow read only if custom claim pst is "true" or not present
I’m building a web app where users sign in with a Firebase Authentication custom token. The token has claims like this:
{
"iss": "------",
"sub": "------",
...
0
votes
0
answers
73
views
How to fix firebase firestore permission/rules error?
I am building a Flutter mobile app using Firebase backend. I have four collections: institutions, resources, resourceTypes, users.
I want the institution's collection to be accessible by any user (...
0
votes
1
answer
49
views
firestore Emulator database query results are incorrect/unstable
I am using the Google Firestore Emulator locally for development. However, when I query the database data, I find that the results are inconsistent and not correct each time. Here is the detailed ...
0
votes
0
answers
27
views
Routing Issue: Transition to /category/smartphones/iphone Opens index.html Instead of category.html
I have a web application running on localhost:5000 using HTML pages (index.html and category.html) with dynamic component loading (e.g., header.html) via the loadComponent function. Links in the menu (...
0
votes
0
answers
187
views
Is it possible to test concurrent HTTP calls and Firestore side effects in Firebase Cloud Functions (Python, Gen 2)?
My goal is to write tests that:
Simulate multiple concurrent HTTP POST requests to a cloud function endpoint (e.g., 2-3 identical webhooks arriving almost simultaneously).
Verify database side ...
0
votes
1
answer
39
views
Firestore security: Incorrect number of arguments supplied to function: diff
I'm trying to use the diff() method in my Firestore rules to ensure the user only edits the allowed fields, however when I try to compile my rules and upload them, I receive the following error in my ...
0
votes
0
answers
51
views
Enforce firestore access for debugging
I have a Flutter app which accesses firestore data in a readonly way, and no user authentication is required for that data. There are some static information in firebase which can be updated without ...
0
votes
1
answer
106
views
Getting the doc from the firestore isnt working as expected
Here is a pic of my firestore data.
I am running this query:
var settings = [];
const queryGetSettings = db.collection('Settings').doc("Category");
var query = queryGetSettings.get()
....
0
votes
1
answer
87
views
Does Firebase Firestore charge for loading cached documents?
When I subscribe to a collection that results in 100 documents, a couple of days later, I start my app again. I am offline. I see all 100 documents because Firestore cached them for me. Then I go ...
0
votes
1
answer
66
views
How to check if attribute matches in an array of maps
Previously, I had the following rule:
allow read: if request.auth.token.email in resource.data.shareWith;
Now, that the data structure changed and shareWith is no longer an array of email addresses, ...
1
vote
1
answer
38
views
How to remove a nested property from an object in Firestore
my firestore stores user data as below:
users (collection)
uid-123 (document one per user)
profile:
name: 'My Name'
options: {
x: 1,
y: ...
1
vote
1
answer
86
views
Is It Safe to Use stream() Inside a Firestore Transaction in Python?
While conducting a code review today, multiple AIs advised against using the stream() function within a Firestore transaction in Python.
However, I couldn't find any mention of this limitation in the ...
1
vote
1
answer
76
views
How to delete Firestore document when a user closes the web page [closed]
I have a web application utilising React and Firestore where users can create "rooms" which, when active, allow users to interact with the host. There is an option to both activate and ...
0
votes
1
answer
31
views
Firestore cardinality vs effective cardinality in Composite Indexing
My question is about indexing and cardinality in Firestore.
I have 3 fields:
owner_id: Thousands of users
domain: Hundreds of domains
category: Only 10 unique one
The composite index, which matches ...
1
vote
1
answer
41
views
Getting read access for subcollections of specific document in case a field matches in the main document only
I have the following rules in Cloud Firestore:
match /users/{userId}/{documents=**} {
allow read: if request.auth.token.email in resource.data.shareWith;
// allow read: if resource.data.test == ...
0
votes
0
answers
44
views
Firebase Cloud Functions FAILED_PRECONDITION error when handling Razorpay webhook with Firestore collection group query
I'm implementing Razorpay webhooks using Firebase Cloud Functions and running into a FAILED_PRECONDITION error when querying Firestore. The webhook handles Razorpay account status updates (activated, ...
-1
votes
2
answers
48
views
Finding the number of fields in a document in Firestore [duplicate]
When working with 'firebase/firestore' in a React app. I have a document identified as:
const docRef = doc(fireStoreDB,'CollectionOne','DocumentTwo');
How can I find the current number of fields in ...