I am creating a simple app mockup in VueJS, using Google Cloud Firestore as a backend. I have a template up and running, and have the app successfully talking to the Firestore. Below is the working component of one of my Vue components, which grabs some data from Firestore and logs to console: So far so good. Console logs an
Tag: google-cloud-firestore
Firebase firestore cloud functions showing Error: Invalid use of type “undefined” as a Firestore argument
I have a project to add currency details into the firestore database and my project is doing with ionic 3 Whenever I add a new document to the collection a trigger function onCreate() will execute and update the document named ‘updated’. But the trigger function always showing an error. sombody please help.. i have spent lot of time on it.
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.