exports.updateRelatedCards = functions.firestore
.document('topic/{newTopic}')
.onWrite((snap, context) => {
const newTopic = snap.data();
// search for the recieved title in a 'relatedCards' subcollection
return firestore
.collection(`card/{anyCard}/related
我想知道在使用.where之后是否有一种获得子集合的方法
这是我的数据库格式
用户<--集合
Bob123
职位<-分收集
post1
Firestore.instance.collection("Users")
.where("followers", arrayContains: id) //id is the users id
//He i want to get the collection of posts that the particular user has posted
我在Firestore中创建了一个集合"Cuisniers“和一个SubCollection "Produits”。我能够从代码中创建文档和字段。
我还可以从集合"Cuisiniers“中检索数据。
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
// We MUST import both the firebase AND firestore modul
因此Firestore结构如下所示:
Collection1/Doc1/Subcollection1/Doc2/Field1
我试图编写一个Firestore规则,以便当我在Collection1中查询Collection1时,只有当Field1包含一个特定的值时,它才被允许。
我编写了以下规则,但在执行查询时出错:
match /Collection1/{documents} {
allow read: if request.auth.uid in
get(/databases/$(database)/documents/Collection1/Doc1/Subcollection1/Doc