【发布时间】:2017-11-12 00:04:38
【问题描述】:
例子:
在继续使用事件调度功能之前,我必须与 Firestore 预约。
Example in the database:
- Companie1 (Document)
--- name
--- phone
--- Schedules (Collection)
-----Event 1
-----Event 2
我有一个执行新计划的函数。
根据示例。 我需要检查 Schedules 集合是否存在。
如果它不存在,我执行调度功能。如果我已经存在,我需要做另一个过程。
这个模式我已经用过了,不对。
db.collection("Companies").document(IDCOMPANIE1)
.get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
for (DocumentSnapshot document : task.getResult()) {
}
} else {
Log.d(TAG, "Error getting documents: ", task.getException());
}
}
});
在继续注册之前,我需要帮助找到一种方法。
【问题讨论】:
标签: android firebase google-cloud-firestore