小编Asy*_*esh的帖子

Firestore 生成的密钥与集合中的自定义密钥?

我在我的 Android 应用程序中使用 Cloud Firestore 数据库,并且我在集合中有不同的文档,例如:用户 uid、餐厅的按键和我的食谱的数字。

我的数据库:

users
  uid1
  uid2
  ...
resturants
  pushedId1
  pushedId2
  ...
recipes
  0001
  0002
  ...
Run Code Online (Sandbox Code Playgroud)

对于我了解使用 uid 的用户,但最好为我的餐厅使用 Firestore 推送的 id?这是约定还是为什么要使用它?

我还尝试使用UUID 类生成唯一键但对我来说只使用数字作为我的食谱更容易。这是一个糟糕的方法吗?

任何帮助将不胜感激,谢谢!

java android firebase google-cloud-firestore

7
推荐指数
2
解决办法
6949
查看次数

标签 统计

android ×1

firebase ×1

google-cloud-firestore ×1

java ×1