This question is essentially the same as question 44799104, only that I provide my index.js (and the only answer there was not helpful, as I do include ‘exports’). In short, I have deployed my function successfully, but it does not show in the console. Where am I going wrong? Here is my index.js: Answer You didn’t actually deploy that function
Tag: firebase
Conditional where clause in firestore queries
I have fetch some data from firestore but in my query I want to add a conditional where clause. I am using async-await for api and not sure how to add a consitional where clause. Here is my function In my main function I am getting a param called ‘type’. Based on the value of that param I want to
Getting ‘firestore/permission-denied’ while integrating firestore in React native mobile app
I’m trying to firestore documents through react native app, but facing the following issue Here is the code and we are triggering button click we are facing this issue Error: Firestore: The caller does not have permission to execute the specified operation. (firestore/permission-denied). Error: Firestore: The caller does not have permission to execute the specified operation. (firestore/permission-denied). Answer If this
Append to an arary field in Firestore
I’m using Firebase and Vuejs to create an database element, which has object array inside. That’s how the field looks, and I want to add tasks through the form into the ‘moreTasks’ as an array. I tried using this, but it just creates new entity in the database. I also tried checking API but I couldnt understand the refs, because
Firestore: Multiple conditional where clauses
For example I have dynamic filter for my list of books where I can set specific color, authors and categories. This filter can set multiple colors at once and multiple categories. How can I add “where” conditionally? Answer As you can see in the API docs, the collection() method returns a CollectionReference. CollectionReference extends Query, and Query objects are immutable.
Firestore: Get subcollection of document found with where
I am trying to get the documents inside an subcollection which is part of an document found with the .where function Example: RootColl/ Doc A/ SubColl 1 Doc 1 Doc 2 Doc 3 SubColl 2 Docs Doc A/ SubColl 1 Doc 1 Doc 2 Doc 3 SubColl 2 Docs I want to get all the documents under SubColl 1 from
Leaderboard ranking with Firebase
I have project that I need to display a leaderboard of the top 20, and if the user not in the leaderboard they will appear in the 21st place with their current ranking. Is there efficient way to this? I am using Cloud Firestore as a database. I believe it was mistake to choose it instead of MongoDB but I
Firebase Cloud Firestore query not finding my document
Here’s a picture of my data: I’m trying to get that document. This works: It returns: I.e., if I know the document’s key I can get the document. This doesn’t work: It just returns No such document! What’s wrong with my query? Answer The difference in your two requests is that in the first case you are retrieving one document
firebase.firestore() is not a function when trying to initialize Cloud Firestore
When I try to initialize Firebase Cloud Firestore, I ran into the following error: Uncaught TypeError: WEBPACK_IMPORTED_MODULE_0_firebase.firestore is not a function I installed firebase with npm install firebase –save previously. Answer I fixed it by importing multiple libraries: firebase and firebase/firestore. That’s because the firebase core library does not include the firestore library.
How to upload multiple files to Firebase?
Is there a way to upload multiple files to Firebase storage. It can upload single file within single attempt as follows. How to upload multiple files to the Firebase storage. Answer I found the solution for my above question and I like to put it here because it can be useful for anyone.