You should store user subscription history in Firestore inside the user collection.

huangapple go评论73阅读模式
英文:

Where should I store user subscription history in Firestore, inside or outside the user collection?

问题

"我正在构建一个Flutter应用程序,我们在其中使用Firestore作为数据库。现在我有一个用户集合,其中包含参数如id、name、email、photourl,我还想要用户的订阅历史,如计划、支付ID、开始日期和结束日期。现在我的问题是,我们应该将订阅集合放在用户集合内部还是外部,哪个选项更好。"

"哪个选项更好?"

英文:

I am building a flutter application, where we uses firestore for database, Now I have a user collection that have parameters like id, name , email ,photourl , And I also want the user subscription history like plan , payment id , start date and end date. Now My question is that, We should be subscription collection inside the user collection or outside the user collection. Which one is good.

Which one is better option

答案1

得分: -1

尝试减少Firestore中的集合数量。在Firestore中减少集合是最好的。尝试将订阅集合放在用户集合内,这样可以使Firestore结构更加高效。

英文:

Try to reduce the number of collections in the firestore. Less collections in the firestore that's the best. Try to do the subscription collection inside the user collection that makes the firestore structure more efficient.

huangapple
  • 本文由 发表于 2023年5月21日 15:33:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76298781.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定