Cloud Firestore collections, triggers, & more!

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ต.ค. 2024
  • Host Jen Person, and guest Todd Kerpelman (from our series Get to Know Cloud Firestore) team up to answer all your burning Firebase questions! They discuss best practices on Cloud Firestore collections, and run through an example of accessing Cloud Firestore through a Cloud Function. Watch to learn more about how to best retrieve your Cloud Firestore data. Please keep all your Firebase questions coming our way by using #AskFirebase on social media!
    Find out how to create a distributed counter → bit.ly/2VO6e8b
    Learn more by reading about the Cloud Firestore Data model → bit.ly/2PZtQnD
    Watch the last episode with Todd → bit.ly/2CdC7OE
    Subscribe to the Firebase Channel → bit.ly/firebase2
    0:46 “@Firebase Hi there! Say I have a collection called "itempurchasehistory", and for every document, I want to save the user that bought the item. Is it best practice to save the user ID as a string, or a direct Document Reference to the user? Thx! 🇳🇱 #AskFirebase #CloudFirestore”
    2:54 “Is there a way to prevent Firestore from writing to local cache when a device is offline? #AskFirebase”
    4:47 “#AskFirebase For Android, how do I keep track of number of docs in a Firestore collection?”
    6:47 "#AskFirebase in functions, how to access firestore document outside of the event context. Say I want to access a doc in onUpdate() of another doc.
    I tried something like this... but get() is undefined
    functions.firestore.document(`users/${e}`).parent.get().then()"

ความคิดเห็น • 32

  • @pkop4
    @pkop4 5 ปีที่แล้ว +3

    Something I don't see pointed out enough, except in the cloud functions section titled "Write idempotent functions", when using cloud functions for a counter or other aggregation query, you have to account for the function possibly getting called more than once for the same write event (not just for "retrys" but by the environment itself, randomly). This isn't noted in the aggregation queries section in the docs.

  • @RobinYoulton
    @RobinYoulton 5 ปีที่แล้ว

    Thanks Jen & Todd, brilliant Firestore advice as always.

  • @gofudgeyourselves9024
    @gofudgeyourselves9024 5 ปีที่แล้ว +18

    Todd is great. Whenever I see him, I feel extremely energetic

  • @MikeDownes
    @MikeDownes 5 ปีที่แล้ว +1

    i love these Q and As.. happy new year, belated 11 days ..

  • @JorgeMartinez-xb2ks
    @JorgeMartinez-xb2ks 5 ปีที่แล้ว +1

    Firebase and Firestore are so good, but these people are so good communicating, teaching, joking and making our lives better so they deserve a direct place at heaven =^)
    God - could it be a quantic simulation??? - bless you!

  • @reymartcanuel7151
    @reymartcanuel7151 5 ปีที่แล้ว

    Really love the #AskFirebase videos. Keep 'em coming guys!

  • @codinginflow
    @codinginflow 5 ปีที่แล้ว

    I have a full Firestore tutorial for Android here:
    th-cam.com/play/PLrnPJCHvNZuDrSqu-dKdDi3Q6nM-VUyxD.html

  • @debkanchan
    @debkanchan 5 ปีที่แล้ว +7

    0 dislikes
    *THIS IS PEAK TH-cam*

  • @atanasdoychinov6491
    @atanasdoychinov6491 5 ปีที่แล้ว

    @Todd Kerpelman - What if I have a game and I need to sync the changes of the players in the team after they were offline. For example: I save online the level of two players. Player 1 is offline and player 2 is online. Player 2 goes to level 3. Player 1 goes to level 2. What will happen after player 1 becomes online? In the online database current level is 3, but player 1 will overwrite the data to level 2 after he or she is online. However it should be 3, not 2 for both players. This is just a small example, that's why I still use RTDB.

  • @lukecross5439
    @lukecross5439 4 ปีที่แล้ว

    Documents are limited to 1 MiB, correct?
    But, if I place a subCollection inside a Document, and that subCollection has many documents, will my source document be filled out?

  • @MrVermont
    @MrVermont 5 ปีที่แล้ว

    #AskFirebase Would love to see more information on performance optimization and testing. For example, if documents contain large maps, do key name lengths matter for network response size? How to do TDD efficiently while working on HTTP callable functions?

  • @patrickmullot73
    @patrickmullot73 5 ปีที่แล้ว

    Hey guys! Congrats for the show and the platform!
    #AskFirebase when will we be able to access firestore documents from Google Cloud Storage rules (for permissioning purposes) ?

  • @eddiejaoude
    @eddiejaoude 5 ปีที่แล้ว

    These are great. Thank you 👍🤓

  • @DiegoFerreiradaSilva
    @DiegoFerreiradaSilva 5 ปีที่แล้ว

    1000 thumbs up for you guys!

  • @NuncNuncNuncNunc
    @NuncNuncNuncNunc 5 ปีที่แล้ว

    Don't forget to be awesome!

  • @lokveeraj
    @lokveeraj 4 ปีที่แล้ว

    #askfirebase : how do you suggest implementing end to end encryption for users texts (like chat) so even the admin of Firestore can’t see the real data in the collections ? Any suggestions? #firebase

  • @jaimeloeuf
    @jaimeloeuf 4 ปีที่แล้ว

    #AskFirebase Will there ever be a managed SQL DB by firebase? (Not the GCP one but rather a more dev/mobile friendly one from firebase)

  • @jalilcompaore
    @jalilcompaore 5 ปีที่แล้ว +1

    Can we get a “Don’t forget!” Show?

  • @aniketbhoite9752
    @aniketbhoite9752 5 ปีที่แล้ว

    4:16 How/where to setPendingWriteValue to false? for to get server write confirm callback

  • @vitikahappy
    @vitikahappy 4 ปีที่แล้ว

    Someone, please help to figure out how can I query nearby documents in Firebase Firestore?
    I need it work in my Android app and know only Java.

  • @RakeshKumar-pb3ve
    @RakeshKumar-pb3ve 5 ปีที่แล้ว

    Firebase doesn't generate token on IPV6 in android. What could be issue?? Or do they not support IPV6???

  • @chelmsneto
    @chelmsneto 5 ปีที่แล้ว

    #AskFirebase
    Cloud Firestore has been in Beta for more than a Year.
    When can we expect a stable one?

  • @Olegatorslife
    @Olegatorslife 5 ปีที่แล้ว

    #AskFirebase
    We want to know how to set up "custom events", ie events that a user performs and then gets tracked
    We want to know how to make a marketing campaign in the form of banners (multiple) and then be able to track them (conversions) and also analyze which campaign performs better.
    We also have a web view where we accept payments, we would like to create a new conversion / event that tracks all payments, both in-app and web-view. For this purpose, we will provide you with JavaScript code examples and an explanation of how the path from event / conversion setup to code installation is. (since we can not see a Token or key at an event when we create it there)

  • @richardsuarez1698
    @richardsuarez1698 5 ปีที่แล้ว

    #AskFirebase whereArrayContains() is not available for Android, is this a bug or Firebase Firestore no longer carries that functionality? according to its reference docs it should be available but i only WhereEqualTo, etc. methods but nothing that's for array use.
    I do have the latest implementation of Firebase Firestore using Android Studio

  • @remoreacts91
    @remoreacts91 5 ปีที่แล้ว +1

    I think they need to make an example video of a complicated cloud function....the examples right now are too easy. The way promises are described is very subtle, and do not explain some important steps. Ofcourse, if you already know node.js, you'll be fine, but for people who are not.

  • @mahaltech
    @mahaltech 5 ปีที่แล้ว

    #AskFirebase
    I ask this question more than 10 time can I use c# to change value of remote config value using Firebase Remote Config Api ?

  • @MrKeyyuki
    @MrKeyyuki 5 ปีที่แล้ว

    #AskFirebase
    Have a nice day, Firebase. I have a question about Firebase Cloud Messaging:
    "How can I send a notification to a topic except someone"
    I build a chat app. It have many chat room, each chat room have unlimited member. I want whenever someone write something in chat room, other one will receive a notification.
    I think it should be topic notification because each chat room maybe have many people. But when sent to topic, It will sent to all, include one who create this message.
    If use individual message, I can choose to send every one in chat room except message creator. But it will be broken when chat room have a lot of member, and very slow.
    So I want a solution for this. Can anybody have an idea.

    • @amitk.512
      @amitk.512 5 ปีที่แล้ว

      The person creating the message is using the app when the notification is received. So you can choose to not display the notification inside app if the creator of notification is same as the logged in user.
      You can send the creator id in data params in notification.
      Let me know if it helps or are you asking something else?

    • @blessing7695
      @blessing7695 5 ปีที่แล้ว

      Can you please ask your question on stackoverflow, share the link and we can discuss this further.

  • @noamgonen6243
    @noamgonen6243 5 ปีที่แล้ว

    Fluffy T Rex? I guess after watching #AskFirebase I will now have to skip to the Nat Geo TH-cam channel to fact check ....

  • @shahoodgmail
    @shahoodgmail 5 ปีที่แล้ว +1

    @2:14 break apart the part to get the user id? Shouldn't it be as easy as calling getId() on the DocumentReference object?

    • @jajasaria
      @jajasaria ปีที่แล้ว

      Actually, I'm thinking about what kind of scenario for what they mean by "break apart". Better if they can provide an example of it.