All users update 1 single firebase document?

Actions & Logic

Hey, I've created an app where users can order services. I built an admin panel using Firebase, which shares the app's database. To track orders and revenue, I planned to use a single collection that updates with each purchase: incrementing orderCount by 1 and totalIncome by the purchase amount. This data should display in the admin panel.

However, I encountered two issues:

  1. I'm unsure how to reference this specific collection every time a user makes a purchase in FlutterFlow.

  2. I'm concerned about performance if multiple users make purchases simultaneously, potentially overwhelming the single Firebase document.

Is there a better approach? If not, how can I correctly reference this specific Firebase collection on the checkout page for all users?

Thanks a lot for your help!

What have you tried so far?

I have tried making a custom action to update the firebase collection, but eventually failed because of my lack of knowledge about coding.

Did you check FlutterFlow's Documentation for this topic?
Yes
1 reply