Questions tagged [google-cloud-firestore]

Introducing FusionDB, a cutting-edge cloud-native database solution that effortlessly scales in real-time to accommodate the demands of today's mobile, web, and server development. Experience seamless storage, synchronization, and data querying capabilities like never before.

Extracting Information from Cloud Firestore through an Express API

I have encountered an issue while trying to retrieve data from four different documents in my firestore database collection. The current code successfully fetches data for the first function, but all subsequent functions return the same data as the first ...

Why is the function being executed twice in a React component when there are no apparent changes to props, state, or context?

Issue: I am working on developing an admin page that allows users to create new posts and view their previously published posts. However, when querying the Firestore database to retrieve the already published posts, I am encountering a problem where the da ...

Improving Firebase Rules to Resolve 'Insufficient Permissions' Error When Retrieving User Information using NextAuth

I'm having an issue retrieving a user's data using NextAuth and Firebase. When I try to run the function, I encounter the error: Uncaught (in promise) FirebaseError: Missing or insufficient permissions. async function getBalance(uid) { const ...

Collaborate on Typescript Interfaces within a Firebase development environment

I've been developing a Firebase project using Angular for the frontend, and incorporating the @angular/fire library. Within this project, I have created multiple interfaces that utilize firebase and firestore types. For example: export interface Schoo ...

How can I receive live notifications for a document as soon as it is created?

My Angular app is connected to Cloud Firestore, and I've created a function in a service to retrieve a user's rating from the 'ratings' collection. Each rating is stored in this collection with the document ID being a combination of the ...

Firestore rules restrict access to the data, however the Angular project is still able to retrieve the collection - ERROR Error: Insufficient permissions or missing

I am currently working on an Angular project that is connected to a Firestore database. Within the database, there is a collection called users, and each document within this collection contains a nested collection named hugeCollection. I have updated the ...

I am looking to fetch information from a different Firestore collection by looping through data using a forEach method within an onSnapshot function

I'm struggling to grasp the concept of rendering data from Firestore in my project. I've searched extensively but haven't been able to find a solution that fits my requirements. Background Information In my Firestore database, I have collec ...

The information retrieved from Firebase is initially displaying on the user interface, only to vanish shortly after

I am working on creating a simple list using all the Documents and their contents in a Collection using Firestore. I have managed to retrieve the data, but now my challenge lies in displaying it properly in the UI. However, I am facing an issue where the d ...

AngularFire2 Firestore Custom Query: retrieve documents based on current date and time.startTime

Welcome to the world of AngularFire2 and Firestore! My objective is clear: Query data from Firestore where startTime matches currentDateRange. I am facing some challenges with creating a dynamic query in Firestore. After going through the official docume ...

I'm running into an issue with my React component where it is rendering before the state is set, causing it to fail. Is there a

Is it possible for me to achieve what I've been attempting for the past week? I feel like I'm so close, yet still can't quite reach my goal. Could it be that what I'm trying to do is impossible? I am using reactjs and next js (although ...

The Angular Fire Firestore module does not include the 'FirestoreSettingsToken' in its list of exported members

When I initially compiled my project, this issue occurred. The error message displayed is as follows: Module '".../node_modules/@angular/fire/firestore/angular-fire-firestore"' has no exported member 'FirestoreSettingsToken' In my a ...

Vue messaging application fails to display data upon mounting

Recently, I've been experimenting with different Vue chat libraries and encountered this interesting piece of code: <template> <p>{{ this.users[0] }}</p> </template> <script> export default { data() { return ...

Is there a way to establish a connection with a secondary Firestore database in Node.js, allowing for the use of multiple Firestore databases

I have set up multiple firestore databases within my project. Using the command line, I created these databases and can view them in the Firestore Databases preview by following the instructions outlined here: https://cloud.google.com/blog/products/databas ...

I successfully installed the Firebase tools using npm, but encountered an error during the process

Alert: Please choose at least one feature. Press SPACEBAR to select features, or mention a feature by executing firebase init [feature_name] ...

The term 'firestore' is not available on the specified type 'typeof import'

I'm facing some trouble setting up this app because the firebase library that has been exported from firebase/app seems to be missing the firestore() method. I have attached an image for reference. Here is my code. Could someone kindly assist me in resolvi ...

Access the filtered data with Vuex and Firestore to display the results

I am looking to enhance my project by implementing a filtering feature. I currently have a buttons component that will trigger the filter search. When I click the restaurant button, it should display the shops with a "Restaurant" value in Firestore. Conv ...

Converting DatetimeWithNanoseconds to a date format in Python Firestore

Looking for a way to convert a Firestore timestamp into milliseconds or a date format using Python in order to make a calculation. Attempting to parse it as a date is resulting in a TypeError. TypeError: strptime() argument 1 must be str, not DatetimeWi ...

Managing Emails with Vue and Firestore

I am facing an issue with updating the 'email' field. Whenever I try to change the email address, it gets updated correctly. However, when I attempt to log in again, the new email address does not work; only the old one seems to be functional. Ho ...

Firestore fails to store the complete object when using addDoc

Greetings! I've encountered an issue with firebase when attempting to addDoc passing an object using the useState Hook. The problem arises where sometimes the object is stored with all fields, and other times only some are stored (despite passing the ...

Encountering the 'Default setting for timestampsInSnapshots now set to true' error in Firestore console

Encountering a Firestore error in the console while using Angular. @firebase/firestore: Firestore (5.8.3): The timestampsInSnapshots setting now defaults to true and does not require explicit setting. It is advised to remove it from firestore.settings( ...

Updating data without having to refresh the page is a useful feature when it comes to deleting a document on Firebase

Currently, I have a button that triggers this function to remove a value from Firebase. These values are being displayed in a flatlist on the same page. The function itself works perfectly fine, but to see the updated changes, I either need to refresh the ...

Is there a way to pre-fill meta tags in Nuxt before the page finishes loading?

Having a Nuxt3 application, I encounter an issue where a blog article fetched from Firestore using a path variable ID is not populating the title and meta tags (<Title> and <Meta>) in time for SEO optimization. Despite setting SSR to true and p ...

The Vue / Firebase App is experiencing issues with the Modal feature due to a lack of definition for '$'

I encountered the following error: 33:7 error '$' is not defined The code snippet below shows AddToCart.js contents. The modal formatting can be found in my Product List component. <template> <div class="add-to-cart"> ...

Receiving a blank array from the firestore database

I have written a code for the LeftBar Component where I am trying to retrieve data stored in the "contacts" document in Firebase. However, I am getting an empty array and I'm not sure why this is happening. Additionally, I would like to know how to ac ...

FirebaseError: The type 'Hc' was expected, but instead, a custom Yc object was provided

I've encountered an issue while attempting to perform a batch entry. The error I'm facing involves passing an array in a .doc file. Interestingly, this approach seems to work perfectly fine on another function where I pass an array into a .doc using loops ...

Error: an empty value cannot be treated as an object in this context when evaluating the "businesses" property

An error is occurring stating: "TypeError: null is not an object (evaluating 'son['businesses']')". The issue arose when I added ['businesses'][1]['name'] to 'son' variable. Initially, there was no error with just 'son', but upon restarting the simulator, ...

Implementing Firebase Firestore Timestamp Function

Encountering an issue while attempting to record the submission time for filtering purposes in Firebase. Allow me to present what I currently have (in a functioning state). -- At the moment, I have a form where users provide information that is then pus ...

Tips for executing a code after a Firestore .update() operation is completed on the server side in Angular

When a user logs in, I want to send a locally generated token to be stored in both localstorage and firestore. The user is then routed to the admin component. In the app component, I will subscribe to the user and compare the stored token with the one in ...

Encountering an issue when retrieving data from Firebase Firestore in NEXT.JS with Firebase SDK Firebase v9 results in an error message

Greetings! I am currently trying to retrieve data from Firebase Firestore by following a tutorial on Firebase v9. However, I encountered an error message that says "FIRESTORE (9.8.4) INTERNAL ASSERTION FAILED: Unexpected state". Below is the code snippet: ...

Error: n.indexOf function is not defined - Issue with Firebase

After integrating Stripe into Firebase, I encountered an issue where a specific line of code is supposed to execute whenever a user upgrades their plan. This code should create checkout sessions in the users' collection, but it throws an error instead ...

Data merging in Firebase 9 and Vue 3 is not functioning properly

I am facing an issue with merging data in my firebase database. I consulted the documentation at https://firebase.google.com/docs/firestore/manage-data/add-data for guidance. After attempting to merge data using setDoc, I encountered an error (Uncaught Ty ...

What is the best way to retrieve nested reference data all at once from a Firestore document?

I have two distinct collections stored within my Firestore database. The first collection is users, and it can be visualized as shown here: https://i.stack.imgur.com/AKlyM.png The second collection is posts, represented by the following structure: http ...

Tips for simultaneously updating a value in multiple collections on firestore?

Currently, I am in the process of developing a forum application using Vue, which is essentially a replica of this platform. In this app, users can post questions, receive answers to those questions, and leave comments on those answers. Each question, answ ...

Issue encountered during deployment where Firebase functions are causing an exception to be

After creating Firebase functions to send notifications on data changes in Firestore, I encountered a problem when trying to transfer the code from my old computer to a new one. The commands are now throwing errors and I have been attempting to fix them fo ...

What could be causing my function to not provide the expected output?

Whenever I try to invoke the function from another part of the code, I encounter an issue where it returns undefined before actually executing the function. The function is stored in a service. login.page.ts: ngOnInit(){ console.log(this.auth.getRole()) ...

Receive immediate notifications for any modifications made to Firestore documents in the past 10 minutes

I have a need to track updates on documents that have been changed after a specific timestamp, which I can achieve with the following code example: const q = query(collection(db, "items"), where("lastChange", ">", "165 ...

Guide on setting up an onSnapshot listener with firestore in combination with express.js

Attempting to implement real-time functionality by adding an onSnapshot listener to a document. Everything functions correctly when the api is called, but any modifications to the data result in encountering the following: Error [ERR_HTTP_HEADERS_SENT ...

Cloud Firestore trigger fails to activate Cloud function

I am facing an issue with triggering a Cloud Function using the Cloud Firestore trigger. The function is supposed to perform a full export of my sub collection 'reviews' every time a new document is added to it. Despite deploying the function successfully ...

Setting up Firestore with @angular/fire 17 and Ionic @ionic/angular 7.6.2 for full offline functionality: a step-by-step guide

Recently, I've delved into app development using Angular, Ionic, and Firebase. Currently, I'm grappling with the challenge of setting up offline capabilities/unlimited cache size with AngularFire, and it's been days of confusion and dead-ends for me! The ...

Troubleshooting: Next JS 13/14 - Server component failing to update data upon revisiting without requiring a refresh

After attempting to retrieve the most recent liked items from a server component in next, I noticed that the data only displays when manually refreshing the page. Even when I navigate away and return, the data is not refetched automatically - however, usin ...

Instructions for sorting an array of objects by Firebase Timestamp

I am looking for a way to order my messages based on timestamp in Firebase v9. In earlier versions, I was able to do this but now I seem to be facing some difficulties. Here is the data structure set up on Firestore: const [messages, setMessages] = useSta ...

Firebase response comes back as a successful 200 code, however the array returned

I've been working on a project involving Firebase and Firebase functions. Right now, I'm struggling to retrieve documents from a collection called 'items'. When I try to make a GET request, all I get is a 200 status code with an empty r ...

losing track of the requested parameters while working asynchronously with Firestore documents

Today is my first time experimenting with firestore and express. Here is the code snippet I am using: app.post('/api/create', (req, res) => { (async () => { try { console.log(req.body); //the above consle.log shows th ...

Obtaining the current timestamp from Firebase Firestore in a React application

In the project I'm currently working on, I am utilizing Firebase Firestore database. To add documents from my front-end React application, I require the current timestamp. import * as firebase from "firebase"; import React, {useState} from 'rea ...

Add the file retrieved from Firestore to an array using JavaScript

Trying to push an array retrieved from firestore, but encountering issues where the array appears undefined. Here is the code snippet in question: const temp = []; const reference = firestore.collection("users").doc(user?.uid); firestore .collec ...

Modal for Firestore CRUD operations update()

Currently seeking assistance with a CRUD system that involves modal dialogues. I have successfully implemented adding and deleting functionalities, but I am encountering an issue with editing. Although I can retrieve the data for each record in its respect ...

Error: In Angular Firebase, the type 'string' cannot be assigned to the type 'Date'

I am encountering an error. The following error is shown: "cannot read property 'toDate' of undefined. Without the toDate() | Date." After further investigation, I found: A Timestamp object with seconds=1545109200 and nanoseconds=0. A helpful resou ...

Encountering difficulties with a custom Firestore service when attempting to extend it after updating to Angular 9

My custom class that wraps Angular Firestore is designed to be extended and used throughout my application. However, after updating to Angular 9, this setup no longer functions properly. For the complete code snippet, visit . The abstract class wrapper: ...

There has been no answer provided. Could this be due to being utilized in an asynchronous function that was not returned as a promise?

I encountered the following error message: Error: No response has been set. Is this being used in an async call that was not returned as a promise to the intent handler? at DialogflowConversation.response (/user_code/node_modules/actions-on-google/dis ...

Firebase allows for the updating of an object within a nested array

Within Firestore, I have a Document that includes a property named "items" which is of type array. This array consists of ShoppingItem objects with the specified structure: export class ShoppingItem { id?: string; name: string; checked = false; } To ...

Asynchronous and nested onSnapshot function in Firestore with await and async functionality

I'm facing an issue with the onSnapshot method. It seems to not await for the second onsnapshot call, resulting in an incorrect returned value. The users fetched in the second onsnapshot call are displayed later in the console log after the value has alrea ...

What is the process for removing a document with the 'where' function in Angular Fire?

var doc = this.afs.collection('/documents', ref => ref.where('docID', '==', docID)); After successfully retrieving the document requested by the user with the code above, I am unsure of how to proceed with deleting that do ...

Most effective method for structuring firebase write operations within an update trigger routine

When it comes to updating multiple fields in a user document in Firebase, I am facing a dilemma. There are various fields that can be updated and have interactions with one another. Should I use a bunch of if statements, each triggering a write action if a ...

Tips for generating and invoking a promise within NodeJS

I have been attempting to access Firestore using a function I created that includes a collection variable. var fetchDataFromFirestore = function(collection, doc){ return promise = new Promise(function(resolve,reject){ //If doc param is null Quer ...

Steps for retrieving multiple documents from Firestore within a cloud function

In my cloud function, I have set up a trigger that activates on document write. This function is designed to check multiple documents based on the trigger and execute if/else statements accordingly. I have developed a method that retrieves all documents u ...

What could be causing the SignatureDoesNotMatch error when attempting to save thumbnail URLs using Firebase Storage Cloud Storage triggers?

Using the firebase resize extension to automatically create resized pictures, such as turning user1profile into user1profile_320x320. A trigger function is in place to update documents in firestore once the thumbnail is generated: const isThumbna ...

Caching the count of subcollections in Firebase

As I work in a React component, my goal is to showcase the total count of two subcollections within a specific document in a collection. The challenge arises when each time I navigate to a different page and return, the responses appear to refetch and req ...

When I attempt to add a todo item by clicking, the Url value is displayed as "undefined"

I am facing an issue with my household app where, upon clicking the button to navigate to the addtodo page, the URL specific to the user's house is getting lost. This results in the todolist being stored as undefined on Firebase instead of under the c ...

What is the best way to transform this date string into a valid Firestore timestamp?

Currently, I am facing an issue in my Angular application that is integrated with Firebase Firestore database. The problem lies in updating a date field from a Firestore timestamp field. To provide some context, I have set up an update form which triggers ...

Firebase Firestore is returning the dreaded [object Object] rather than the expected plain object

I've created a custom hook called useDocument.js that retrieves data from a firestore collection using a specific ID. However, I'm encountering an issue where it returns [object Object] instead of a plain object. When I attempt to access the nam ...

Removing data from firestore/storage does not follow the expected pathway

I have created an image gallery for users using Firebase Storage and React, allowing them to upload and delete images. However, I am facing an issue where the deletion process is taking longer than expected. Expected flow: User clicks on the trashcan ico ...

Steps to load dynamic configuration in AngularFire2

I've been attempting to initialize angularfire2 with dynamic values, but I encounter errors when using aot. let _env = { apiKey: 'key...', authDomain: dynamicValueFromConfig, databaseURL: 'url...', ...

My Vuefire firestore() function is failing to properly bind my data

I am encountering a problem that has me stumped. VueFire worked perfectly in another application I developed, but for some reason it is not binding correctly in my current one. Below you can see the code snippet on the page where the firestore() function i ...

Dealing with the mystery of the Next.js Stripe webhook elusive function error

I've been working on setting up a Stripe webhook in my NextJS app to write data to Firebase Firestore, but for some reason, stripe.webhook.constructEvent is showing up as undefined even though everything seems to be properly configured. I'm using the foll ...

What is the process of querying both a collection and a subcollection in Firebase using AngularFire?

I have a structure in my firebase database that looks like this: /profiles/{uid}/displayName /email /otherAttribues /roles/{roleName}/someAttribute /someOtherAttribute The reason ...

What is the process for invoking an External Javascript Firestore function within a Typescript file?

Trying to figure out how to integrate a Firestore trigger written in an external JavaScript file (notifyNewMessage.js) into my TypeScript file (index.ts) using Node.js for Cloud functions. Both files are located in the same directory: https://i.stack.imgu ...

Sometimes the valueChanges of a Firestore collection in Take(1) can be inconsistent

Currently, I am incorporating AngularFire2 into my project. In the service that I have created, it looks like this: getItems(thing: string): Observable<Item[]> { return this.db.collections('item', ref => ref.where('things', 'array-contains', ...

Should one consider using Firestore for working with Node.JS in offline mode?

Recently, I developed a basic Node.js program on my Raspberry Pi 3 that interfaces with a Google Cloud Firestore database. My ultimate aim is to build iOS and Android apps that can access the Firestore database simultaneously. Upon testing going offline a ...

Unable to bring in the Firebase Firestore Colletion

When working on my next app, I encountered an error while trying to call a Firestore Collection. The specific error message that appeared when I ran the app was: FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicat ...

Can Cloud Functions be used to establish a connection between Cloud Firestore and Realtime Database?

My current project involves designing my firebase database with a unique approach. I am looking to establish a connection between certain document fields in firestore and real-time database fields. This way, any changes made in the real-time database will ...

Automatically Populate list upon webpage initialization - React, Redux, Firebase

A webpage I am working on consists of two main components: Categories and Items By utilizing the function initCategories() called within the componentDidMount() lifecycle method of Categories, I successfully display all categories on the screen. The initC ...

Timestamps Update in Cloud Functions Triggered by Warnings

My Firebase Cloud Functions setup looks like this: index.js const functions = require('firebase-functions'); const trackVote = require('./trackVote') const admin = require('firebase-admin'); admin.initializeApp(); exports.trackVote = trackVote.handler; ...

Having trouble getting Firestore/Firebase to work with Next.js?

Hey everyone, I could really use some help here. I've been working on integrating Firebase into my Next.js app for the API. Everything works well when I build and run locally, but once I deploy to Vercel for production, I encounter a 500 - Internal Server ...

What could be causing my React child component to not update when changes are made to an array passed down in props after fetching new data?

My Profile.js component is responsible for fetching activity data related to a specific user from the URL parameter and updating the profileActivity state. This state is then passed down to my child component, ProfileActivity.js, where it should be display ...

search for a specific value within a nested subfield of an asterisk star field in Firestore

Here is the data I have: { root: { _rEG: { fen: 'value' }, _AS: { fen: 'value' }, _BSSA: { fen: 'value' } } } I would like to query using where('root.*.fen', '==', 'value'). Any suggestions on how I can achieve this? I was thinking o ...