I have these collection of items from firestore: availability : true stocks: 100 item: item1 I kind of wanted to decrement the stocks after submitting the form: I have these where() to compare if what the user chose is the same item from the one saved in the firestore. This is how I’ll submit my form and I’ve set the
Tag: firebase
Is it normal that I am able to invoke firebase cloud functions from any kind of frontend app?
I am using axios to call the firebase cloud functions I have created with express/firebase. I realized even without using and without importing the firebase and without initializeApp(firebaseConfig) in my frontend, I was able to call my cloud functions with the axios with the following way: How I create cloud functions: index.js foo.js Is this a normal behavior or is
Firebase – Vue database integration not working
I am trying integrating Firebase with Vue 4 application is currently getting the following error. Uncaught TypeError: db__WEBPACK_IMPORTED_MODULE_1_.default.database is not a function I am using “firebase”: “^9.0.0” “vue”: “^3.0.0” My function call is as below I tried the following the following suggestion but it didn’t work. Thank you! Answer The new modular SDK does not use namespaces anymore. So you
Firestore: What’s the pattern for adding new data in Web v9?
I have seen in many places that to access nested documents and collections the pattern is something like db.collection(“users”).doc(“frank”).collection(“pets”) etc. This makes a lot of sense to me and is easy to understand. The trouble is, my (React) project is set up in the Web version 9 way. I’ve combed the docs over and over and can’t see anything that
TypeError: a.preventDefault is not a function
I’m trying to register auth with firebase using the name, email and password, but when I tried to register with that info then give me an error, like this: TypeError: a.preventDefault is not a function I’m sure my firebase connect is ok, because before I have save post data from this project, so, I have tried code like this way:
How can I fix “Failed to compile src/index.js ‘firebase’ is not defined no-undef”?
I am trying to use a React web app to read and write stuff in a Firebase realtime database. Every time I run “npm run start”, I get this error message. This is what package.json, src/index.js, build/index.html, and public/index.html looked like when I first got this error. (is it bad to have 2 index.html files?) Lines 25 and 28 in
Undefined from promise using .then() JavaScript
I am trying to get data from Firestore using multiple queries, but the returned data is always undefined, even though console.log(data) in .then() block shows the data exist. Answer You have to return the promise in your function getPeers(): EDIT: A little advice when handling errors in async functions, in your code you have the catch() handler with a console.log:
Query documents in firestore from an array of ID’s
I was wondering how I can query documents from a firestore collection from an array of ID’s? I only want the documents in the collection that are in the array of ID’s. I looked at another answer and think my approach is correct, however, I am getting an error. The error happens because the function is not finding any documents
Firebase Cloud Function finished with status: ‘response error’
I have a cloud function that is returning a lot of data (50’000 documents) as objects. When I run it I get the error finished with status: ‘response error’. This only happens when I export all of the data, when a limit (up to 20’000) is applied it works without problem. This lets me think that the response might be
React Native Firestore remove object in array
I cannot delete object inside my array of object in a document from Firestore. Here my Document I have tried that } Here the error msg: Someone can help me ? Or do you have any ideas how can i do for delete and update a object inside an array ? EDIT: Is fix, it was bad formating of JS