google-cloud-firestore

firebase.storage() is not a function in JavaScript

拜拜、爱过 提交于 2020-11-29 08:59:52
问题 I'm new to web development and firebase and a error is appearing to me. I've not been able to solve it so came here to seek for help. The error displayed is firebase.storage() is not a function . It seems that the firestorage is not set correctly in my computer. However, I've followed the instructions download from the google website itself and it did not change a thing. I've seen some other questions regarding this on Stack Overflow, but they use node or react which is not my case. Can

firebase_tools not found when trying to remove firestore collection from cloud functions

僤鯓⒐⒋嵵緔 提交于 2020-11-28 18:20:40
问题 I am trying to remove a collection using callable firebase function. I took a sample code from here. The sample code has a "firebase_tools" element. return firebase_tools.firestore .delete(path, { project: process.env.GCLOUD_PROJECT, recursive: true, yes: true, token: functions.config().fb.token }) Which apparently is not part of firebase-function I am getting following error in function logs: Unhandled error ReferenceError: firebase_tools is not defined The document also mentions that: You

firebase_tools not found when trying to remove firestore collection from cloud functions

*爱你&永不变心* 提交于 2020-11-28 18:10:30
问题 I am trying to remove a collection using callable firebase function. I took a sample code from here. The sample code has a "firebase_tools" element. return firebase_tools.firestore .delete(path, { project: process.env.GCLOUD_PROJECT, recursive: true, yes: true, token: functions.config().fb.token }) Which apparently is not part of firebase-function I am getting following error in function logs: Unhandled error ReferenceError: firebase_tools is not defined The document also mentions that: You

Paginate with Firestore

时间秒杀一切 提交于 2020-11-28 02:39:18
问题 I want to paginate my query with Firestore because I have a very large collection (more than 20k documents growing). By pagination I mean displaying an array of numbers to my user, if he clicks on one, it redirects him to a specific chunk of my collection and only fetches this chunk when he clicks. For instance, if I have 100 documents and I want to display 10 per page, I have an array of numbers from 1 to 10. Each time the user clicks, it loads 10 products. I have implemented infinite

Can I change the name of a document in Firestore?

你离开我真会死。 提交于 2020-11-27 04:54:37
问题 I'm currently working on an app where I have to retrieve data from Google's Firestore. My data structure looks like this: users - name@xxx.com - more data Is there a way for me to change the name@xxx.com to just name? I can't see a method to change the name of a document. 回答1: I think the best way to do this is to get the data from 'name@xxx.com' and upload it to a new document called 'name' and then delete the old one. Just as an example: const firestore = firebase.firestore(); // get the

Can I change the name of a document in Firestore?

谁说我不能喝 提交于 2020-11-27 04:49:50
问题 I'm currently working on an app where I have to retrieve data from Google's Firestore. My data structure looks like this: users - name@xxx.com - more data Is there a way for me to change the name@xxx.com to just name? I can't see a method to change the name of a document. 回答1: I think the best way to do this is to get the data from 'name@xxx.com' and upload it to a new document called 'name' and then delete the old one. Just as an example: const firestore = firebase.firestore(); // get the

Can I change the name of a document in Firestore?

青春壹個敷衍的年華 提交于 2020-11-27 04:49:06
问题 I'm currently working on an app where I have to retrieve data from Google's Firestore. My data structure looks like this: users - name@xxx.com - more data Is there a way for me to change the name@xxx.com to just name? I can't see a method to change the name of a document. 回答1: I think the best way to do this is to get the data from 'name@xxx.com' and upload it to a new document called 'name' and then delete the old one. Just as an example: const firestore = firebase.firestore(); // get the

Flutter Firestore causing D8: Cannot fit requested classes in a single dex file (# methods: 71610 > 65536) in Android Studio

百般思念 提交于 2020-11-25 06:05:00
问题 I am attempting to use firestore with a Flutter app in latest version of Android Studio. I have followed these instructions exactly. https://www.youtube.com/watch?v=DqJ_KjFzL9I&list=PLjxrf2q8roU2HdJQDjJzOeO6J3FoFLWr2&index=9 I even got them to work last week with a different app. Now I get the following error when I attempt to run my new app after completing all the steps up to (and including) updating pubspec.yaml. Keep in mind, in this example, i am getting the error on a fresh flutter

Flutter Firestore causing D8: Cannot fit requested classes in a single dex file (# methods: 71610 > 65536) in Android Studio

流过昼夜 提交于 2020-11-25 06:04:12
问题 I am attempting to use firestore with a Flutter app in latest version of Android Studio. I have followed these instructions exactly. https://www.youtube.com/watch?v=DqJ_KjFzL9I&list=PLjxrf2q8roU2HdJQDjJzOeO6J3FoFLWr2&index=9 I even got them to work last week with a different app. Now I get the following error when I attempt to run my new app after completing all the steps up to (and including) updating pubspec.yaml. Keep in mind, in this example, i am getting the error on a fresh flutter

Firestore Document “Too much contention”: such thing in realtime database?

被刻印的时光 ゝ 提交于 2020-11-25 04:05:36
问题 I've built an app that let people sell tickets for events. Whenever a ticket is sold, I update the document that represents the ticket of the event in firestore to update the stats. On peak times, this document is updated quite a lot (10x a second maybe). Sometimes transactions to this item document fail due to the fact that there is "too much contention", which results in inaccurate stats since the stat update is dropped. I guess this is the result of the high load on the document. To